Reputation: 18595
Can I add HTML attributes dynamically through ng-repeat
?
<select>
<option ng-repeat="thing in things" {{thing.ghosted||'disabled'}}>
{{thing.name}}
</option>
</select>
What am I doing wrong here?
Upvotes: 1
Views: 505
Reputation: 25159
For something like this, it'd be good to use a directive.
<select>
<option ng-repeat="thing in things" ng-disabled="thing.ghosted">
{{thing.name}}
</option>
</select>
Upvotes: 3