Today i am going to talk about How to Call Dynamic declared function by Angular js ?.
Like we use simple method to create the dynamic function in html.
//This is dynamic declared function call() which is used with HTML
var html_content = “<a href=’#’ ng-click=’call()’>”;
//Add this html in your page. In this step you need to make any Id to receive the html data from Angular Js. like
var $store_in_html_page = $(html_content).appendTo(“#name of Id”);
// Now you need to use $compile.
Now what is $compile ?
$compile is angular js service which is transverse the DOM looking for attribute.
How I use this ?
Its very simple
//Now you pass the "store_in_html_page" in compile function and call your scope . There $scope variable update the changes in controller so dynamic function easy to accessed by $scope.
After this your dynamic created function easy to accessed by controller in every place of controller.