Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Update ngStyle.js #6838

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/ng/directive/ngStyle.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,15 @@
* @param {expression} ngStyle {@link guide/expression Expression} which evals to an
* object whose keys are CSS style names and values are corresponding values for those CSS
* keys.
*
* For some CSS elements, they must be surounded with single quotes('). The single quote must be used for AngularJS
* to recognize the property and the value. They should each be surrounded in there own set of quotes as shown in the
* example with 'background-color' below.
*
* @example
<example>
<file name="index.html">
<input type="button" value="set" ng-click="myStyle={color:'red'}">
<input type="button" vlaue="Background" ng-click="myStyle={'background-color':'blue'}">
<input type="button" value="clear" ng-click="myStyle={}">
<br/>
<span ng-style="myStyle">Sample Text</span>
Expand Down