使用ng repeat AngularJS的动态HTML属性

使用ng repeat AngularJS的动态HTML属性,angularjs,Angularjs,我可以通过ng repeat动态添加HTML属性吗 <select> <option ng-repeat="thing in things" {{thing.ghosted||'disabled'}}> {{thing.name}} </option> </select> {{thing.name} 我在这里做错了什么?对于这种情况,最好使用指令 <select> <option ng

我可以通过
ng repeat
动态添加HTML属性吗

<select>
    <option ng-repeat="thing in things" {{thing.ghosted||'disabled'}}>
        {{thing.name}}
    </option>
</select>

{{thing.name}

我在这里做错了什么?

对于这种情况,最好使用指令

<select>
    <option ng-repeat="thing in things" ng-disabled="thing.ghosted">
        {{thing.name}}
    </option>
</select>

{{thing.name}

+1我知道但不明白
{{thing.ghosted | | | disabled'}}
的意思