I incorporate the System
module in my component.
export class LoginComponent {
constructor() {
System.import('app/login/login.js');
}
}
The file loads successfully, however, TypeScript compiler raises an error
Error:(10, 9) TS2304: Cannot find name 'System'.
In addition, my browser console displays
EXCEPTION: Error: Uncaught (in promise): Error: Error: http://localhost:3000/app/login/login.js detected as register but didn't execute.
at ZoneDelegate.invoke (http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:332:29)
at Object.NgZoneImpl.inner.inner.fork.onInvoke (http://localhost:3000/node_modules/angular2/bundles/angular2.dev.js:2111:31)
at ZoneDelegate.invoke (http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:331:35)
at Zone.run (http://localhost:3000/node_modules/angular2/bundles/angular2-polyfills.js:227:44)
Error loading http://localhost:3000/app/login/login.js
Error: Uncaught (in promise): Error: Error: http://localhost:3000/app/login/login.js detected as register but didn't execute.(…)
What steps can I take to resolve this issue?