1
我有一個數組或顏色= ['紅','白','金','黑']; 我試圖做類似下面的代碼..如何使用ng-if在ng-repeat中重複數組?
<span ng-repeat="color in item.colorOptions" ng-init="color">
<lable ng-if="'Red' == {{color}}"> This is Red..</lable>
<lable ng-if="'Black' == {{color}}"> This is Black..</lable>
</span>
爲什麼我不能用NG-如果像上面的代碼?什麼是一個原因,什麼可能是另一種使用ng-if或ng-show/hide在這裏的方法?
這裏假設item.colorOptions = [ '紅', '白', '黃金','黑色']; – Laxmikant