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

fix($compile): replace/templateUrl transclude issue #7772

Closed
wants to merge 1 commit into from

Conversation

petebacondarwin
Copy link
Member

See #7183

@mary-poppins
Copy link

Thanks for the PR! Please check the items below to help us merge this faster. See the contributing docs for more information.

  • Uses the issue template (#7772)

If you need to make changes to your pull request, you can update the commit with git commit --amend.
Then, update the pull request with git push -f.

Thanks again for your help!

@petebacondarwin
Copy link
Member Author

So the problem here appears to be if you have:

  • a templateUrl+replace directive (info) inside an async transclusion directive (trans)
  • and the info directive also has a transclusion-based directive at its root (transSync)

In this scenario, the transcludeFn is not passed to the transSync nodeLinkFn at link time.

(The trans directive is simulating what ng-if does, which is call its transludeFn during a subsequent digest if its value evaluates to true)

If the trans directive is not async then the transcludeFn does get passed.

In debugging you can see that the delayedNodeLinkFn is not passing the transcludeFn down to the afterTemplateNodeLinkFn

If a "replace" directive has an async template, which contains a transclusion
directive at its root node, then outer transclusions were failing to be
passed to this directive.  An example would be uses of `ngIf` inside and
outside the template.

Collaborated with @caitp

Closes angular#7183
Closes £7772
@petebacondarwin petebacondarwin changed the title test($compile): failing test to demonstrate issue #7183 fix($compile): replace/templateUrl transclude issue Jun 13, 2014
@caitp
Copy link
Contributor

caitp commented Jun 13, 2014

LGTM --- might be good to clean up some of the empty lines that the diff adds but it's not that big a deal.

@caitp
Copy link
Contributor

caitp commented Jun 13, 2014

🎊

caitp pushed a commit to caitp/angular.js that referenced this pull request Jun 13, 2014
If a "replace" directive has an async template, which contains a transclusion
directive at its root node, then outer transclusions were failing to be
passed to this directive.  An example would be uses of `ngIf` inside and
outside the template.

Collaborated with @caitp

Closes angular#7183
Closes angular#7772
petebacondarwin added a commit that referenced this pull request Jun 13, 2014
If a "replace" directive has an async template, which contains a transclusion
directive at its root node, then outer transclusions were failing to be
passed to this directive.  An example would be uses of `ngIf` inside and
outside the template.

Collaborated with @caitp

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

Successfully merging this pull request may close these issues.

3 participants