angular.js - angularJS ng-style用法
phpcn_u1582
phpcn_u1582 2017-05-15 16:58:40
0
1
850

angularJS ng-style usage thank you

phpcn_u1582
phpcn_u1582

reply all(1)
phpcn_u1582

The

ng-style directive corresponds to a key-value pair composed of CSS attributes. It is an object and adds the corresponding style to the corresponding element. The following is an example given in the Angular API document. The document address is https://docs. angularjs.org/api/ng/directive/ngStyle You may need to circumvent the firewall, or you can read the explanation of the novice tutorial http://www.runoob.com/angularjs/ng-ng-style.html

<input type="button" value="set color" ng-click="myStyle={color:'red'}">
<input type="button" value="set background" ng-click="myStyle={'background-color':'blue'}">
<input type="button" value="clear" ng-click="myStyle={}">
<br/>
<span ng-style="myStyle">Sample Text</span>
<pre>myStyle={{myStyle}}</pre>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template