Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
AngularJS – ng-style Directive
The ng-style Directive in AngularJS helps you to set the CSS style of an HTML element conditionally. If the condition evaluates to True, the style will be applied. The expression inside the ng-style directive must be an object. This is supported by all the HTML elements.
Syntax
..content..
Example − ngStyle Directive
Create a file "ngStyle.html" in your Angular project directory and copy-paste the following code snippet.
ngStyle Directive Welcome to Tutorials Point
AngularJS | ngStyle Directive
Welcome to Tutorials PointmyStyle={{myStyle}}
Output
To run the above code, just go to your file and run it as a normal HTML file. You will see the following output on the browser window.
Advertisements
