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

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

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