AngularJs ng class Expression Syntax

AngularJs ng-class Expression Syntax

The ng-class Syntax:

<span ng-class="{active : flags}"></span>

The ng-class Expression Syntax example code

<!DOCTYPE html>
    <meta charset="utf-8" />
    <link rel="stylesheet" href="style.css" />
    <script src=""></script>
        var app = angular.module('ngClassApp', []);
        app.controller('ngClassCtrl', function ($scope) {

<body ng-app="ngClassApp" ng-controller="ngClassCtrl">
    <h1>AngularJs ng-class Expression Syntax</h1>
        <a ng-click="flags =! flags">
            <span ng-class="{active : flags}">
                <h4>Click and See the flags Result <br>Class flag: {{flags}}</h4>


Anil Singh is an author, tech blogger, and software programmer. Book writing, tech blogging is something do extra and Anil love doing it. For more detail, kindly refer to this link..

My Tech Blog -
My Books - Book 1 and Book 2 Powered by Blogger.