I want to apply the color picker runtime value as a background color of span text. How can I use model as a color value?
HTML:
<body ng-app="">
<input type="button" value="set color" ng-click="myStyle={color:'red'}">
<input type="button" value="clear" ng-click="myStyle={}">
<input type="text" name="abc" class="color" ng-model="abc" ng-change="myStyle={color:'green'}">
<br/>
<span ng-style="myStyle">Sample Text</span>
<pre>myStyle={{myStyle}}</pre>
</body>
Plunker: http://plnkr.co/edit/APrl9Y98Em0d6rxuzRDE?p=preview