I am very new to angularjs and require help on calling a function on url call. I am directly accessing the query params from url using
http://localhost/index.html#/?defined=true&var1=value1&var2=value2&
$location.search()['defined'];
now , within my controller I have a function 'caller' which is being called on events like ng-change , ng-model etc. on the html page which works fine
angular.module('ngAp').controller
('ngCntrl',function($scope,$http,$location{
$scope.caller = function() {
// code logic
}
}
What I am trying to do is to call the function 'caller' when I directly access the above url
$location.search()['defined'];
if (defined == "true" )
{ //call the caller function.
}
I have no idea how can I call the function when i directly call the url. Any help is greatly appreciated.
$scope.caller();Did you mean something else?