I have an Object like this
var obj = [
{
'id':1,
'color':'#ff0000',
'name':'final'
},
{
'id':2,
'color':'#ffff99',
'name':'start'
}
];
By using this I am rendering radio button group:
<div class="btn-group" ng-repeat="item in obj">
<button type="radio" class="btn-group btn-xs btn-group-xs">{{item.name}}</button>
</div>
Here My Question are:
1.How can I apply background-color property on ng-click to button what is present in obj.
2. change the color of button text to contrast/opposite color. (That means if button background color is Black want to change text color to white) .
Here I have tried with ng-class And ng-style but Some where I did wrong.I don't know where it is.
Can any one help me. Thanks