我想實現 跳轉按鈕是紅色,刪除按鈕是藍色,添加是白色,但是目前這樣循環的話,全是“btn-warning”這個樣式,也就是紅色!angular.module('demoAPP').controller('demoCtrl', function($scope) { var demoData = [ { "Name" : "操作", "action" : "跳轉" }, { "Name" : "操作", "action" : "刪除" } { "Name" : "操作", "action" : "添加" } ] $scope.demo = demoData; });<table> <tr ng-repeat="item in demo"> <td>{{item.Name}}</td> <td><button type="button" class="btn btn-warning">{{item.action}}</button></td> </tr> </table>
angularjs ng-repeat 循環不同的樣式
梵蒂岡之花
2018-11-13 13:14:41
