Get `Cannot read property 'type' of null` using Angular2 AoT ngc compiler with RC5

前端 未结 2 1174
北荒
北荒 2021-01-27 21:02

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

2条回答
  •  离开以前
    2021-01-27 21:41

    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

    1. const lambda => export function
    2. default export => named export
    3. private, protected accessors should be changed to public for any members accessed from template
    4. dynamic component template => static template
    5. moduleId should be set on components with templateUrl

提交回复
热议问题