ng-style

Download angularjs eBook

Introduction

The 'ngStyle' directive allows you to set CSS style on an HTML element conditionally. Much like how we could use style attribute on HTML element in non-AngularJS projects, we can use ng-style in angularjs do apply styles based on some boolean condition.

Syntax

  • <ANY ng-style="expression"></ANY >

  • <ANY class="ng-style: expression;"> ... </ANY>

Related Examples

Stats

32 Contributors: 2
Friday, January 20, 2017
Licensed under: CC-BY-SA

Not affiliated with Stack Overflow
Rip Tutorial: info@zzzprojects.com

Download eBook