I'm building an HTML block in Angular Controller to avoid the ng-repeat slowness on large data sets.
I'm trying to add a event handler ng-click="clicker()"
to the html string and adding it to the DOM as below.
document.getElementById("Test").innerHTML="<button ng-click='clicker()'>Click</button>";
When this element is rendered, ng-click is not working as expected - On click, no action is performed. My understanding is that Angular is not aware of this element as this point of time. In that case how do I make Angular recognise it as a valid Angular event?
I tried to make use if bind-as-html
which didn't help.
I'm forced to choose this path due to cons with ng-repeat.