问题
How do I get around this?
As far as I know, JIT needs moduleId's on the components to find the template and styles if the component has one.
However, AOT doesnt use module and you get a "Cannot find name 'module'" error when compiling for AOT.
I don't want to go through all my modules and remove the Id for AOT, as I use JIt for DEV and AOT for production release only in order to get the performance benefits.
I've used the new angular 4 seed app for this: https://angular.io/docs/ts/latest/guide/setup.html
来源:https://stackoverflow.com/questions/43210191/angular-2-aot-not-like-moduleid-in-my-components