JSFiddle - React, Tailwind, and code Playground
HTML
<div ng-app="classApp">
<div ng-controller="ClassCtrl">
<span ng-if="showValue">
<p ng-class ="{'red': show, 'green': show1}">{{name}}
</p>
</span>
</div>
</div>
CSS
.red
{
color:red;
}
.green
{
color:green;
}
JavaScript
var app = angular.module('classApp',[]);
app.controller('ClassCtrl',function($scope){
$scope.name = "my first ng-class logic";
$scope.show = false;
$scope.show1 = true;
$scope.showValue = true;
});