user2920788 user2920788 - 17 days ago 6x
HTML Question

Replace text with angular

I am trying to replace certain values in a div using angular. The problem is that the div content is generated by an outside service so I cant just add

and be done with it. I've tried the following and some various variations with no luck

var o = angular.element(document.querySelector('#maintwo'));
var r = o[0].innerHTML.replace('TWO','REPLACE');
angular.element(document.querySelector('#maintwo')).innerHTML = r;



just remove angular.element() from this line, and it will work as you need it : angular.element(document.querySelector('#maintwo')).innerHTML = r;

Do it , like : document.querySelector('#maintwo').innerHTML = r;