Reputation: 15006
in angular I have a function that looks like this:
$scope.memberselect =function(myname){
$scope.member = (myname);
};
I try to set a class based on $scope.member. LIke this:
ng-class="{expanded: member = mathieu}"
I want the node with the attribute to get the value expanded if $scope.member = mathieu.
Upvotes: 0
Views: 72
Reputation: 43947
ng-class="{ 'expanded' : member == 'mathieu' }"
or
ng-class="{ 'expanded' : true }[member == 'mathieu']"
Upvotes: 2