1
我可以通过ng-repeat
动态添加HTML属性吗?ng-repeat的动态HTML属性AngularJS
<select>
<option ng-repeat="thing in things" {{thing.ghosted||'disabled'}}>
{{thing.name}}
</option>
</select>
我在这里做错了什么?
我可以通过ng-repeat
动态添加HTML属性吗?ng-repeat的动态HTML属性AngularJS
<select>
<option ng-repeat="thing in things" {{thing.ghosted||'disabled'}}>
{{thing.name}}
</option>
</select>
我在这里做错了什么?
对于这样的事情,使用指令会很好。
<select>
<option ng-repeat="thing in things" ng-disabled="thing.ghosted">
{{thing.name}}
</option>
</select>
+1我甚至不知道指令被内置的。 –
+1我知道,但不明白'{{thing.ghosted ||“禁用”}}'意义 –