Angularjs 如何使用角度指令作为注释?
我试图使用Angularjs 如何使用角度指令作为注释?,angularjs,angularjs-directive,Angularjs,Angularjs Directive,我试图使用ng repeat和ng if作为but <div><strong>Loop this:</strong></div> <!-- directive: ng-repeat-start: val in arr --> <p ng-if="true">Hello {{val}}!</p> <!-- directive: ng-repeat-end --> <strong>Do
ng repeat
和ng if
作为but
<div><strong>Loop this:</strong></div>
<!-- directive: ng-repeat-start: val in arr -->
<p ng-if="true">Hello {{val}}!</p>
<!-- directive: ng-repeat-end -->
<strong>Don't show this stuff:</strong>
<!-- directive: ng-if false -->
<div ng-repeat-start="val in arr">{{val}}</div>
<div ng-repeat-end>({{val*2}})</div>
<!-- end directive: ng-if -->
循环这个:
你好{{val}
不要显示此内容:
{{val}}
({{val*2}})
(请注意,$scope.arr=[1,2,3,4,5];
)
给出了什么?这是因为它们都被声明为仅用作属性: , . 检查“用法”部分