How to use single-spa-angularjs - 2 common examples

To help you get started, we’ve selected a few single-spa-angularjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alocke12992 / single-spa-starting-from-scratch / src / angularJS / angularJS.app.js View on Github external
import singleSpaAngularJS from 'single-spa-angularjs';
import angular from 'angular';
import './app.module.js'
import './routes.js';

// domElementGetter is required by single-spa-angularjs
const domElementGetter = () => document.getElementById('angularJS');

const angularLifecycles = singleSpaAngularJS({
  angular,
  domElementGetter,
  mainAngularModule: 'angularJS-app',
  uiRouter: true,
  preserveGlobal: false,
})

export const bootstrap = [
  angularLifecycles.bootstrap,
];

export const mount = [
  angularLifecycles.mount,
];

export const unmount = [
github CanopyTax / single-spa-examples / src / angularjs / angularjs.app.js View on Github external
import singleSpaAngularJS from 'single-spa-angularjs';
import angular from 'angular';
/* We import app.module.js before routes.js because we need to create the 'app' module
 * before we try to use it. SystemJS (which is used to bundle this angularjs app) does
 * ensure that imports are executed with the first import exectued first. This nuance
 * is something caused by angularjs's dependency injection layer that was invented before
 * es6 import statements.
 */
import './app.module.js';
import './routes.js';

const domElementGetter = () => document.getElementById('angularjs');

const angularLifecycles = singleSpaAngularJS({
  angular,
  domElementGetter,
  mainAngularModule: 'single-spa-app',
  uiRouter: true,
  // angular-ui-router references `window.angular` :(, so we have to preserve the window.angular global
  preserveGlobal: true,
});

export const bootstrap = [
  angularLifecycles.bootstrap,
];

export const mount = [
  angularLifecycles.mount,
];

single-spa-angularjs

the logic needed to register angular 1 apps with single-spa

MIT
Latest version published 3 years ago

Package Health Score

51 / 100
Full package analysis

Popular single-spa-angularjs functions