I could be off base here, but another approach is to use the "controller 
as" option in your directive and save what you want accessed in the 
directive as attributes of "this" in the controller instead of on scope. 

Would be interested in hearing from others more experienced in Angular if 
there is a reason not to do the above too.

Iain

On Wednesday, October 31, 2012 1:54:17 PM UTC-7, Olivier Clément wrote:
>
> Hi all,  I have a newb question here;
>
> Let's say I have a Directive in which I define a few functions that will 
> affect its behavior/presentation,
> but I want to be able to call these functions from outside the directive 
> (the page's controller for instance);
>
> What would be the best approach? 
>
> 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