I am including ng2-bs3-modal for creating modals in angular2 , according to this thread . Since the ng2-bs3-modal and the js files that it loads (like modal.js, modal-header.js) does not take .js as their extension by default , i had to use deafultJsExtension: true to achieve that . To prevent angular errors according to that same thread(angular is loading its modules again in the browser), i included system.config directly after loading systemjs , instead of writing it after loading angularjs,
<script src="node_modules/es6-shim/es6-shim.min.js">
</script>
<script src="node_modules/systemjs/dist/system-polyfills.js">
</script>
<script src="node_modules/systemjs/dist/system.src.js">
</script>
<!-- 2. Configure SystemJS -->
<script>
System.config({
defaultJSExtensions: true,
packages: {
angular: { defaultExtension: false },
app: {
format: 'register',
defaultExtension: 'js'
},
},
map: {
'ng2-bs3-modal': 'node_modules/ng2-bs3-modal',
}
});
System.import('node_modules/jquery/dist/jquery.min.js')
System.import('node_modules/bootstrap/dist/js/bootstrap.min.js');
System.import('app/js/main')
.then(null, console.error.bind(console));
</script>
<script src="node_modules/angular2/bundles/angular2-polyfills.js">
</script>
<script src="node_modules/rxjs/bundles/Rx.js">
</script>
<script src="node_modules/angular2/bundles/angular2.dev.js">
</script>
Now, sometimes it works fine, sometimes it says that browser.js, core.js not found, also system.js error
(in console it says GET http://localhost:3000/angular2/core.js 404 (Not Found) -- system.src.js:1068 Assertion failed: loading or loaded -- system.src.js:291
can someone identify this Thanks