Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Isolated scope unicity assertion on same element works on Chrome, fails on Firefox #3208

Closed
blandinw opened this issue Jul 11, 2013 · 3 comments

Comments

@blandinw
Copy link

Hello,

Given an element with directives A and B, with A.scope = {foo: '=bar'} and B.scope = true, Firefox wrongly throws a "Multiple directives [A B] asking for isolated scope".

I traced it to the applyDirectivesToNode(directives, ...) function in the compile.js file (https://github.com/angular/angular.js/blob/master/src/ng/compile.js#L681)

On Firefox, directives == [A, B], thus wrongfully triggering the assert when processing B, because newIsolateScopeDirective is set to A.

On Chrome, directives == [B, A], avoiding the bug.

The obvious fix would be to put the assert inside the if statement (why would you check for duplicate isolate scope this early?)

Please advise,
Thanks

@ar7hur
Copy link

ar7hur commented Jul 11, 2013

+1

@blandinw blandinw closed this as completed Sep 3, 2013
@Sinetheta
Copy link

Is there a reason this was closed? I'm still seeing the same behaviour.

@dtelaroli
Copy link

I solved a same problem setting the priority level in the parent lower then child directive and setting scope:true to the child

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants