javascript - AngularJS ng-click inside innerHTML -


i have code below:

acrosstext = acrosstext + activewordlist[w].placeorder + ". " + activewordlist[w].clue + "<button ng-click='speak()'>speak</button> " + "<br /><br />"; document.getelementbyid('div1').innerhtml = acrosstext; 

however ng-click="speak()" inside innerhtml not firing. what's wrong?

the code not being compiled. must compile using $compile.

https://docs.angularjs.org/api/ng/service/$compile


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -