Reputation: 689
Something wrong with my new Angular2 application. I call my main boot
file next way within my index.html:
SystemJS.config({
packages: {
app: {
format: 'register',
defaultExtension: 'js'
}
}
});
SystemJS.import('src/app/prod/boot').then(null, console.error.bind(console));
In my console i see some errors:
If i specify an extension explicity:
SystemJS.import('src/app/prod/boot.js').then(null, console.error.bind(console));
All will be OK, but i have the same problem inside my component with import another component without specify an extension:
import {Component} from 'angular2/core';
import {ROUTER_DIRECTIVES, RouteConfig, RouteParams} from 'angular2/router';
import {AppComponent} from './app.component';
Upvotes: 3
Views: 274
Reputation: 71911
It's because your package isn't app
but src/app
. Either move your index.html
inside your src
folder or change the packages definition of your SystemJS
config to this:
SystemJS.config({
packages: {
'src/app': {
format: 'register',
defaultExtension: 'js'
}
}
});
Upvotes: 3