+1

On Wednesday, 6 November 2013 05:45:43 UTC, Alex Buchanan wrote:
>
> Tossing on a +1 here. This is yet another "gotcha" on a long list when it 
> comes to directives, and left me scratching my head for a bit. In addition, 
> I think there must be tons of use cases for having many, totally unrelated 
> directives on one element, each wanting it's own sandbox to work in.
>
> On Monday, June 25, 2012 10:48:36 PM UTC-7, Pete Bacon Darwin wrote:
>>
>> Yes, this sounds sensible to me.
>>
>> On 26 June 2012 04:36, Oliver Batchelor <[email protected]> wrote:
>>
>>> Definitely gets my vote too.
>>>
>>> Oliver
>>>
>>> On Tue, Jun 26, 2012 at 3:26 PM, Nick R <[email protected]> wrote:
>>> > I was hoping this thread would go somewhere.  The current behavior of
>>> > isolation scopes really bothers me.  I want a nice syntax like the one
>>> > isolation scopes have, but for isolating directives from the template
>>> > entirely.
>>> >
>>> > I don't see this as creating extra scopes in the same way as other 
>>> scopes in
>>> > the page.  Directive isolation scopes would not be used in the template
>>> > unless it was a replacement template defined in the directive itself. 
>>>  I
>>> > don't want the directive's isolation scope to affect the outer 
>>> template at
>>> > all.  If you want to affect the outer template's scope, you can put a
>>> > controller on your directive and add things to the scope there.
>>> >
>>> > On Tuesday, June 19, 2012 4:24:41 PM UTC-7, Igor Minar wrote:
>>> >>
>>> >> Allowing multiple scopes per element is something that we considered, 
>>> but
>>> >> we feared that this would result in a lot of confusion and would also 
>>> make
>>> >> debugging much harder that's why we decided to limit this to one 
>>> scope per
>>> >> element.
>>> >>
>>> >> The isolate scope is supposed to allow you to do encapsulation which
>>> >> ultimately allows component reusability. Having two directives ask 
>>> for an
>>> >> isolate scope doesn't really make much sense, because the isolate 
>>> scope is
>>> >> useful mainly in situations in which a component/directive is backed 
>>> by a
>>> >> template with bindings. And you can't have the same element backed 
>>> with two
>>> >> or more templates.
>>> >>
>>> >> My suggestion is to use isolate scopes when you are creating reusable
>>> >> components that are backed by a template. If you want to compose 
>>> multiple
>>> >> directives together, you should design them in a way that make one 
>>> directive
>>> >> the main one (with the template) and the other directives are just 
>>> helper
>>> >> directives (sort of like traits or mixins in some programming 
>>> languages).
>>> >
>>> > --
>>> > You received this message because you are subscribed to the Google 
>>> Groups
>>> > "AngularJS" group.
>>> > To view this discussion on the web visit
>>> > https://groups.google.com/d/msg/angular/-/IMVBGhiPQ6gJ.
>>> >
>>> > To post to this group, send email to [email protected].
>>> > To unsubscribe from this group, send email to
>>> > [email protected].
>>> > For more options, visit this group at
>>> > http://groups.google.com/group/angular?hl=en.
>>>
>>> --
>>> You received this message because you are subscribed to the Google 
>>> Groups "AngularJS" group.
>>> To post to this group, send email to [email protected].
>>> To unsubscribe from this group, send email to 
>>> [email protected].
>>> For more options, visit this group at 
>>> http://groups.google.com/group/angular?hl=en.
>>>
>>>
>>

-- 
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/groups/opt_out.

Reply via email to