AngularJS ng-class instruction
Modify <div> element categories:
<Option value = "sky"> Sky </ option>
<Option value = "tomato"> Tomato </ option>
<Div ng-class = "home ">
<H1> Welcome Home! </ H1>
<P> I like it! < / P>
Definition and Usage
ng-class instruction is used to dynamically bind HTML elements of one or more CSS classes.
ng-class values of instruction can be a string, an object, or an array.
If a string, a plurality of class names separated by spaces.
If the object, you need to use key-value pairs, the class name for the key you want to add, value is a Boolean value. Only in value will be added to true class.
If it is an array, or may be composed of a combination of string objects, elements of the array can be strings or objects.
All HTML elements are supported.
|expression||An expression that returns one or more class names.|