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