1. 事件模式
$scope.clickEvent = function(event) { if ($(event.target).hasClass('active')) { $(event.target).removeClass('active'); } else { $(event.target).addClass('active'); } };
<p ng-click='clickEvent($event)'>...</p>
2. 直接崁入
<p ng-class="{active: data.selected}">...</p>
3. Style
<p ng-style="{myStyle}" ng-click="myStyle={color:'red'}">...</p>