Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js"></script>
<meta charset=utf-8 />
<title>ng-class</title>
</head>
<body ng-app>
  <div ng-controller="Ctrl" >
    
    <p ng-class="{true: 'active', false: 'inactive'}[isActive]">Hello World</p>
</div>
</body>
</html>
 
.active{
  color:red;
}
.inactive{
  color:blue;
}
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
annaismepro
0viewers