import singleSpaAngular1 from 'single-spa-angular1';
import angular from 'angular';

import '../assets/crdsAngular.bundle.js';

const domElementGetter = () => document.getElementById('crossroads-net');

const angularLifecycles = singleSpaAngular1({
	angular,
	domElementGetter,
	mainAngularModule: 'crossroads',
	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,
];

export const unmount = [
	angularLifecycles.unmount,
];
