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 -->
難道僅僅是一個開發的可讀性風格偏好?還是有任何性能差異,或其他?乍看之下,似乎評論將有較少的可用性,你可以給一個元素賦予值,附加更多的類類或屬性等等...