I'm trying to insert an html tag with ng-click event in the kendo editor. When I get the inserted data and show in a div, ng-click is not working. The normal onclick in javascript is working fine, but ng-click is not.
The below given is the <a>
tag inserted on the editor text area.
<a ng-click="testMsg()"><span>' + nodeId + '</span></a>
Any idea on how to resolve this ?
onclick
is DOM native event handler butng-click
isn't. Only those functions that are registered in the scope will be available. Any built-in functions will NOT be available tong-click
without an explicit assignment to the scope as my example shows.TL;DR: The method
testMsg
is not exposed to the controller scope. Try adding something like$scope.testMsg = testMsg;
will solve your problem.