Javatpoint Logo
Javatpoint Logo

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:

Test it Now

Example2:

Test it Now




Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA