标签:style blog color io ar sp div on cti
我发现 ng-class="{yourclass:true,outerclass:false}" 竟然不起作用...囧....
幸好有Google ....
1 <p ng-class="{{ class }}">First</p> 2 <p ng-class="getClass()">Second</p> 3 <p ng-class="class">Third</p> 4 <p ng-class="{ ‘red‘: true }">Fourth</p>
控制器
1 angular.module(‘app‘, []) 2 .controller(‘Ctrl‘, [‘$scope‘, function($scope) { 3 $scope.class="red"; 4 $scope.getClass = function() { 5 return $scope.class; 6 }; 7 }]);
CSS
.red {
color: red;
}
标签:style blog color io ar sp div on cti
原文地址:http://www.cnblogs.com/xieyier/p/4028790.html