mirror of
https://github.com/Hopiu/angular.js.git
synced 2026-03-17 07:40:22 +00:00
docs(ngClass): distinguish between CSS classes and scope properties
Closes #4914
This commit is contained in:
parent
8f283fe473
commit
fd7bca22e1
1 changed files with 7 additions and 7 deletions
|
|
@ -98,18 +98,18 @@ function classDirective(name, selector) {
|
|||
* @example Example that demonstrates basic bindings via ngClass directive.
|
||||
<example>
|
||||
<file name="index.html">
|
||||
<p ng-class="{strike: strike, bold: bold, red: red}">Map Syntax Example</p>
|
||||
<input type="checkbox" ng-model="bold"> bold
|
||||
<input type="checkbox" ng-model="strike"> strike
|
||||
<input type="checkbox" ng-model="red"> red
|
||||
<p ng-class="{strike: deleted, bold: important, red: error}">Map Syntax Example</p>
|
||||
<input type="checkbox" ng-model="deleted"> deleted (apply "strike" class)<br>
|
||||
<input type="checkbox" ng-model="important"> important (apply "bold" class)<br>
|
||||
<input type="checkbox" ng-model="error"> error (apply "red" class)
|
||||
<hr>
|
||||
<p ng-class="style">Using String Syntax</p>
|
||||
<input type="text" ng-model="style" placeholder="Type: bold strike red">
|
||||
<hr>
|
||||
<p ng-class="[style1, style2, style3]">Using Array Syntax</p>
|
||||
<input ng-model="style1" placeholder="Type: bold"><br>
|
||||
<input ng-model="style2" placeholder="Type: strike"><br>
|
||||
<input ng-model="style3" placeholder="Type: red"><br>
|
||||
<input ng-model="style1" placeholder="Type: bold, strike or red"><br>
|
||||
<input ng-model="style2" placeholder="Type: bold, strike or red"><br>
|
||||
<input ng-model="style3" placeholder="Type: bold, strike or red"><br>
|
||||
</file>
|
||||
<file name="style.css">
|
||||
.strike {
|
||||
|
|
|
|||
Loading…
Reference in a new issue