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

ng-if on the root element in a template for isolated scope directives will cause a scope level to be skipped #9915

Closed
pyoungerv opened this issue Nov 4, 2014 · 6 comments

Comments

@pyoungerv
Copy link

in an isolate scope directive, if the root element of the template uses the ng-if (or presumably any transclusion) the directive will inherit the exterior scope instead of its own.

apparently related: is there a reason that root element of isolate scope directives are not bound to their own scope? this is easily seen in chrome debugger by clicking on an element with an isolate-scope class and checking its $scope within the console.

@pkozlowski-opensource
Copy link
Member

@pyoungerv I'm not sure I understand your use-case. On top of this we are missing essential info here like AngularJS version. Could you please provide a minimal reproduce scenario using plunker or similar?

Thnx!

@caitp
Copy link
Contributor

caitp commented Nov 6, 2014

it's still reproducible in the latest snapshot.

replace directive with isolate scope -> template with a top level element transclusion directive -> wrong scope.

@pkozlowski-opensource
Copy link
Member

Hmm, OK, it sounds similar to #9932
Didn't investigate so this is a stab in a dark...

@caitp
Copy link
Contributor

caitp commented Nov 11, 2014

I believe #9932 is a duplicate, if not of this issue then of a different one.

@pkozlowski-opensource
Copy link
Member

Ok, let's close this one as a duplicate of #9932 since there are reproduce scenarios there.

@caitp
Copy link
Contributor

caitp commented Nov 11, 2014

#9837 is another one

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

No branches or pull requests

3 participants