I have a scenario where I have to add DOM elements using jQuery. But the application I'm working on is developed with angular and I need those elements accessible in Angular. Example Scenario:
function addElement(){
$('body').append('<div id="outsideDiv" data-ng-click="callFn()">Added from outside angular.</div>')
}
angular.module('myApp',[]).controller('someController',function($scope){
addElement();
$scope.callFn = function(){
console.log("Function Called");
}
});
I have a similar scenario. How can I access "#outsideDiv" and how my click function will get called? Is there a way to make angular walk the DOM manually and register newly added elements?