salix/@salix/app/src/bootstrap.js

19 lines
514 B
JavaScript
Raw Normal View History

2016-11-04 10:32:27 +00:00
import {ng} from 'vendor';
import {NAME as SALIX} from './module';
2016-10-05 05:55:53 +00:00
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, [SALIX]);
};