0
到目前为止我只使用指令为Elements
或Attributes
是Comment
样式指令真的只有一种样式选择?将角度指令用作注释有利吗?
app.directive('heading', [function() {
return {
replace: true,
restrict: 'M',
template: '<header> <h1>The First Title</h1> <h2>2nd Title</h2> </header>'
};
}])
指令作为ê字元素,一个 ttribute,Ç姑娘和Co 米换货:
<heading></heading>
<p heading></p>
<div class="heading"></div>
<!-- directive: heading -->
难道仅仅是一个开发的可读性风格偏好?还是有任何性能差异,或其他?乍看之下,似乎评论将有较少的可用性,你可以给一个元素赋予值,附加更多的类类或属性等等...