AngularJS Search Change Event -
AngularJS Search Change Event -
i need event $routechangesuccess
$location.search() variable. calling $location.search('newview'), , need way know when changes.
thanks!
you should utilize $scope.$watch
:
$scope.$watch(function(){ homecoming $location.search() }, function(){ // reaction });
see more $watch
in angular docs.
if looking add-on of 'newview', query string above code work.
i.e. http://server/page
http://server/page?newvalue
however, if looking alter in 'newview' above code not work.
i.e http://server/page?newvalue=a
http://server/page?newvalue=b
you need utilize 'objectequality' param phone call $watch. causes $watch utilize value equality, instead of object reference equality.
class="lang-js prettyprint-override">$scope.$watch(function(){ homecoming $location.search() }, function(){ // reaction }, true);
notice add-on of 3rd param (true).
search angularjs
Comments
Post a Comment