I am receiving dynamically data (in json format), and need to change the background images of buttons. Every buttons have ids so its easy to know, which button will be manupulated.
But I am having problem, when I try to manupulate the background-image of a button dynamically.
<button id="1111_1111_c">Value1</button> <button id="2222_2222_d">Value1</button>
I have tried to manupulate like so: (with JQuery)
var btnId = '2222_2222_d'; $('#' + btnId).css('background-image','url(images/btn_red.gif)');
but it happens nothing. If I try the same as pure JQuery, it works.
I know there is angular dom-updater or event to update the dom. But dont know how to do that.
Is there a solution with directives or using ng-class ?