156
AngularJS ng-style Directive
The AnglarJS ng-style directive facilitates you to set CSS style for the HTML elements. The value of ng-style attribute must be an object, or an expression returning an object. Object contains CSS properties and values, in key value pairs.
It is supported by all HTML elements.
Syntax:
Parameter explanation:
expression: It specifies an expression which returns an object where the keys are CSS properties, and the values are CSS values.
Let’s take an example to demonstrate the usage of ng-style directive.
See this example:
Example2:
Next TopicAngularJS ng-submit Directive