This is the main idea of my code:
HTML (jade):
#preferencesBox(ng-click="toggleCustom()") .glyphicon.glyphicon-heart
CSS
#preferencesBox.active{ color: #d04f37; }
Angular:
$scope.check = true; $scope.toggleCustom = function() { $scope.check = $scope.check === false ? true: false; };
I want to add css color : #d04f37 when the user clicks on the parent #preferencesBox . Adding / removing .active is a jQuery way. What should my ng-class or break code look like?
angularjs css angularjs-ng-click
Diolor
source share