對ng-repeat的表格內容添加不同樣式:ng-style


對ng-repeat的表格內容添加不同樣式,html代碼:

<tr ng-repeat="x in tableData">
    <td>{{x.networkName}}</td>
    <td>{{x.network}}</td>
    <td ng-style="{background: x.status === -1 ? '#f0ad4e' : x.status === 1?'#5cb85c':x.status === 2?'#f04124':'#a5a5a5'}">{{x.status | status }}</td>
</tr>

 

實現效果:


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM