ng-class in angularjs

The ngClass directive allows you to dynamically set CSS classes on an HTML element by databinding an expression that represents all classes to be added.

Say Example, If text box is touched/invalid/error you can highlight with different colors like..

touched – green

invalid – orange

error – green

Similarly you can have your own scenarios of using this beautiful ng-class.

Example with clear scenario:

https://docs.angularjs.org/api/ng/directive/ngClass

http://scotch.io/tutorials/javascript/the-many-ways-to-use-ngclass

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s