为生产设置Angular

时间:2016-11-12 17:04:48

标签: angularjs production

我一直在尝试遵循运行angular app in production的建议。但是我一直在努力禁用comment和css类指令:

$compileProvider.commentDirectivesEnabled(false);
$compileProvider.cssClassDirectivesEnabled(false);

当我尝试将这些命令添加到配置块时,我收到错误:

$compileProvider.commentDirectivesEnabled is not a function

下面的codepen演示了我的问题,如果你注释掉这两行,那么代码运行没有任何问题:

http://codepen.io/anon/pen/RoaKbj?editors=1010

1 个答案:

答案 0 :(得分:1)

这两种方法在您正在使用的角度1.5.8 version中不存在。

它们存在于1.6.0-rc.0 version中。

相关问题