kratos2333
2/16/2017 - 6:11 AM

ng-class and ng-if (ng-class can be included a objects with the key and expression pair to be the object, ng-if is similar to if statement )

ng-class and ng-if (ng-class can be included a objects with the key and expression pair to be the object, ng-if is similar to if statement )

<div ng-controller="mainController">
                <input type="text" ng-model="name" />
                <div class="alert" ng-class="{'alert-warning': name.length < character, 'alert-danger': name.length > character}" ng-if="name.length !== character">
                    Must be {{character}} characters.
                </div>
                <h1>Hello {{lowercaseHandle()}}!</h1>
                
            </div>