Trying to execute some code when controller needs to refresh an object in 
the view.
Both a controller and a directive in the same file.

var motoAdsApp = angular.module("motoAdsApp");
motoAdsApp.controller('AirportControllers', function($scope, $http, 
AirportService) {
    $scope.refresh

.....
});

motoAdsApp.directive('aDirective', 
function() {
    return {
      restrict: 'E',
      scope:    {
        refresh:   '='
      },
      link:     function(scope, element, attrs ) {
        scope.$watch('refresh', function() {
          alert(1234);
        })
      }
    };
}); .

At some point  in the controller I am changing refresh to true but no alert 
is fired. Please help.

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to