我尝试将ng-repeat
和ng-if
用作comment directives但 neither seems to work (plnkr) 。
<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 -->
(请注意$scope.arr = [1,2,3,4,5];
)
提供什么?