I have noticed in some directives return statements are added in the link 
function on a directive. in the example below it is a call to $watch but I 
have seen other things like scopes etc. Or in a controller where the last 
call to set a scope variable is returned. Is this necessary? what is this 
used for?

angular.module('angular-flot', []).directive('flot', function() {
  return {
    restrict: 'EA',
    template: '<div></div>',
    scope: {
      dataset: '=',
      options: '='
    },
    link: function(scope, element, attributes) {
    ...
    ...
    ...
    *  return scope.$watch('options', onOptionsChanged, true);*
    }
  };
});

-- 
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