AOT 编译是 angular@4.0.0 的默认设置吗? [英] Is the AOT Compilation the default on angular@4.0.0?

查看:22
本文介绍了AOT 编译是 angular@4.0.0 的默认设置吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

angular@4.0.0 和 angular/cli@1.0.0 上的 AOT 编译是默认的吗?我们今天正在迁移我们的应用程序,我不知道它的文档是否仍然有效:https://angular.io/docs/ts/latest/cookbook/aot-compiler.html

Is the AOT Compilation the default on angular@4.0.0 and angular/cli@1.0.0 ? 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

ps.: It's error only appears with ng build -target=production

我认为这种错误不应该发生在 JIT 编译...

I think wich this kind of error should not occurs on JIT Compilation...

推荐答案

自从 @angular/cli@1.0.0-beta.28 他们已经将 AOT 编译成生产版本的默认设置.如果您不希望这样(即使出于性能原因我强烈建议您使您的应用程序 AOT 兼容),您可以在构建命令中使用 --aot=false 参数

Since @angular/cli@1.0.0-beta.28 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 编译是 angular@4.0.0 的默认设置吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆