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

ng-transclude can't access ng-repeat scope #8182

Closed
metrophos opened this issue Jul 14, 2014 · 2 comments
Closed

ng-transclude can't access ng-repeat scope #8182

metrophos opened this issue Jul 14, 2014 · 2 comments

Comments

@metrophos
Copy link

Hi!

If I use ng-transclude with ng-repeat I can't access the ng-repeat scope. The scope of ng-transclude is not a child of ng-repeat. On 1.3.0-beta.10 it works correct. The plunker example below shows the issue. I also added my workaround but it's nasty.

http://plnkr.co/edit/GIXzsOuurH1umAcH7kuc?p=preview

@Narretz
Copy link
Contributor

Narretz commented Jul 14, 2014

What you see in 1.3.0-beta.11 is the correct behavior: ng-transclude specifically inherits from the parent scope, not from the directive scope. This is just the way it works. See #7874 for more discussion on this, and specifically #7874 (comment) for a good workaround that doesn't involve hacking ngTransclude

@metrophos
Copy link
Author

ah ok and thanks for your answer. Is this the same reason that ngIf is not any more a child of his directive controller?

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

2 participants