(My original post hasn't shown up but it may have been marked as spam as I 
tried to embed the codepen...)

I've created a simply plugin system for a widget and I've hit a snag 
related to scoping. I have a single root widget html tag that users can add 
plugins to, however these "directives" are moved to the various sub widgets 
that the root widget is made up of.

 

The problem in essence is when you have two or more directives on the one 
DOM element, and the first (highest priority) is the actual sub widget 
which has an isolate scope, and the rest are lower priority plugins. A 
plugin directive might add an element to the DOM during the compile phase 
and define it's own controller. Since the element is appended during the 
compile it is linked to the isolate scope. Fine. However I was wondering if 
it was possible for all these to share the isolate scope, I know I can 
just require the controllers and use an API they provide for communication, 
but I've been experimenting with a couple of options and could do with some 
insights from the community.

 

It would be useful if the scope hierarchy was nested so that the isolate 
scope is the outermost parent, although I know that this probably goes 
against it's intention.

 

Perhaps this *codepen* <http://codepen.io/derekdon/pen/GLcnv> might help 
demonstrate the ideal setup.
 

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