score:3

Accepted answer

You don't have to reload your controller m8. $scope.$watch is what you need:

https://docs.angularjs.org/api/ng/type/$rootScope.Scope#$watch

Example:

$scope.$watch('global_m', function(newValue, oldValue) {
  // global_m was changed, new value is 'newValue'
});

You have to declare $scope.global_m first, in order to use the $watch observer. You can do the same for the other variable you want to watch.


Related Query