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 ||「禁用」}}'意義 –