Update to Angular2 2.0.0-rc.5, run in browser without any warning, but when try AOT compile with ngc -p
command, get the flowing error:
Here is my project https://github.com/beginor/learning-angular2
Update to Angular2 2.0.0-rc.5, run in browser without any warning, but when try AOT compile with ngc -p
command, get the flowing error:
Here is my project https://github.com/beginor/learning-angular2
Do not use default exports in your code:
// somefile.ts
export default function (...) {
...
}
...
// some-other-file.ts
import whatevar from './somefile';
use explicit names instead
// somefile.ts
export function whatevar(...) {
...
}
...
// some-other-file.ts
import { whatevar } from './somefile';
AOT is incompatible with default exports (among other things). But unlike other incompatibilities, this one generates the most cryptic error message ever.
All these errors are related to AoT. This blog post explains the changes to be made in your code.
Making your Angular 2 library statically analyzable for AoT