除去角JS帮手HTML注释? [英] Remove helper HTML comments in Angular JS?

查看:109
本文介绍了除去角JS帮手HTML注释?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法来prevent从创建帮手HTML注释角?例如,

Is there a way to prevent Angular from creating "helper" HTML comments? For example,

<div ng-include="myTemplate"></div>

将转变成类似

<!-- ngInclude: 'hurr-durr.html' -->
<div ng-include="myTemplate"></div>

如何停止?我看了成角来源,我已经看到了这些助手被无条件document.createComment内几乎每一个指令产生的,所以我想有使用上的一个配置的设置是一次没有办法阻止他们全部供应商或东西。
但是,也许有一些自定义的角度建立一个没有帮手?
我想我可以写一些文书上士/咕噜任务来删除/每当我脚手架一个新项目从角的来源发表意见.createComment-S。或者,也许你们已经知道了做一个小提琴?而且,这引起了我的最后一个问题:
在这些意见在某种程度上对角的正常运作的关键?如果我删除它们,它会引起一些不稳定的我的应用程序?应公正改写CSS和处理它?

How do I stop this? I've looked into the Angular source, and I've seen these "helpers" are generated by an unconditional document.createComment inside almost every directive, so I guess there's no way to stop them all at once by using a config setting on a provider or something. But maybe there is some custom Angular build without "helpers"? I suppose I could write some Yeoman/Grunt task to remove/comment the .createComment-s from Angular's source whenever I scaffold a new project. Or maybe you guys know of a fiddle that already does that? And also, this raises my last question: Are those comments somehow crucial to the Angular's normal functioning? And if I remove them, will it cause some kind of instability in my app? Should a just rewrite the CSS and "deal with it"?

推荐答案

的意见是如何处理的角某些要素是至关重要的。删除它们目前还不是一个选项。什么问题你用它有?

The comments are crucial to how Angular handles certain elements. Removing them is not currently an option. What issues are you having with it?

这篇关于除去角JS帮手HTML注释?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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