I hope this saves someone a headache with styles that use dashes, especially since bootstrap has become so popular.
I am using angular 1.0.5 by way of
\'icon-white\'
works as well (with AngularJS 1.2.7)
After hours of hacking around, it turns out the dash gets interpolated! Quotes are needed.
<i class="icon-home" ng-class="{'icon-white': someBooleanValue}">
I hope this helps someone from tearing their hair out.
UPDATE:
In older versions of Angular, using a backslash also does the trick, but not in the newer versions.
<i class="icon-home" ng-class="{icon\-white: someBooleanValue}">
The former is probably preferred, since you can more easily search for it in your favorite editor.
alternative for uses ng-class :
.menu-disabled-true{
color: red;
}
.menu-disabled-false{
color: green;
}
<div ng-controller="DeathrayMenuController">
<p class=menu-disabled-{{status}}>shanam</p>
<button ng-click="action()">click me</button>
</div>
<script>
function DeathrayMenuController($scope) {
$scope.status=true
$scope.action= function(){
$scope.status=!$scope.status
}
}
</script>