问题描述
AOT编译是否为[email protected]和angular/[email protected]的默认设置?我们今天正在迁移我们的应用程序,但我不知道它的文档是否仍然有效: https://angular.io/docs/ts/latest/cookbook/aot -compiler.html
Is the AOT Compilation the default on [email protected] and angular/[email protected] ?We are migrating our apps today, and i don't know wheter its docs are still valid:https://angular.io/docs/ts/latest/cookbook/aot-compiler.html
我遇到了一些类似AoT编译错误的问题:属性"myModel"是私有的,只能在类"MyComponent"中访问.
I'm having some issues that appears with AoT Compilations errors like that:Property 'myModel' is private and only accessible within class 'MyComponent'.
ps .:仅在 ng build -target = production
我认为在JIT编译时不应发生此类错误...
I think wich this kind of error should not occurs on JIT Compilation...
推荐答案
@angular/[email protected]
,他们已将AOT
编译作为生产版本的默认编译.如果您不希望这样做(即使出于性能原因我强烈建议您使应用程序与AOT兼容),也可以在构建命令中使用--aot=false
自变量
Since @angular/[email protected]
they've made the AOT
compilation the default for production builds. If you do not want that (even though I strongly advice you for performance reasons to make your app AOT compatible), you can use the --aot=false
argument for your build command
这篇关于AOT编译是[email protected]的默认设置吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!