文章詳情頁
angular.js - angular ng-class里面可以用 {{}} 取值嗎
瀏覽:52日期:2024-09-15 11:00:17
問題描述
angular ng-class里面可以用 {{}} 取值嗎
問題解答
回答1:謝邀,ng-class的所有用法,可以查看 the-many-ways-to-use-ngclass
數據
$scope.users = [{ id: 1, name: `Lolo`, icon: true}, { id: 2, name: ’Semlinker’, icon: false}];
HTML模板
<ul> <li ng-repeat='user in users' ng-class='{’tab’: user.icon}'> {{user.id}} - {{user.name}} </li> </ul>
上一條:angular.js - 通過數據中children的個數自動生成能點擊展開的div下一條:angular.js - angular的ui-router的$stateChangeStart事件沒有觸發。是寫法有問題嗎
相關文章:
1. python - flask sqlalchemy signals 無法觸發2. 為什么python中實例檢查推薦使用isinstance而不是type?3. mysql里的大表用mycat做水平拆分,是不是要先手動分好,再配置mycat4. window下mysql中文亂碼怎么解決??5. python - 獲取到的數據生成新的mysql表6. python - (初學者)代碼運行不起來,求指導,謝謝!7. sass - gem install compass 使用淘寶 Ruby 安裝失敗,出現 4048. linux - 【已解決】fabric部署的Python項目Apache啟動之后提示403Forbidden該如何解決?9. python的文件讀寫問題?10. javascript - js 對中文進行MD5加密和python結果不一樣。
排行榜
