20 lines
534 B
JavaScript
20 lines
534 B
JavaScript
import {ng} from 'core/vendor';
|
|
import appName from './module';
|
|
|
|
export const bootstrap = () => {
|
|
const selector = 'selector';
|
|
|
|
let _script = document.currentScript || (() => {
|
|
let scripts = document.getElementsByTagName('script');
|
|
return scripts[scripts.length - 1];
|
|
})();
|
|
|
|
let _element = _script && document.querySelector(_script.getAttribute(selector));
|
|
if (!_element)
|
|
throw new Error('Element is not defined');
|
|
|
|
ng.bootstrap(_element, [appName], {
|
|
strictDi: true
|
|
});
|
|
};
|