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

fix($compile): use the correct namespace for transcluded svg elements #9415

Closed
wants to merge 1 commit into from

Conversation

tbosch
Copy link
Contributor

@tbosch tbosch commented Oct 3, 2014

This fixes the case when a directive that uses templateUrl
is used somewhere in the children
of a transcluding directive like ng-repeat.

Fixes #9344
Related to #8808

This fixes the case when a directive that uses `templateUrl`
is used somewhere in the children 
of a transcluding directive like `ng-repeat`.

Fixes angular#9344
Related to angular#8808
@tbosch tbosch self-assigned this Oct 3, 2014
@tbosch tbosch added this to the 1.3.0-rc.5 milestone Oct 3, 2014
@tbosch
Copy link
Contributor Author

tbosch commented Oct 3, 2014

@IgorMinar Could you review this?
We had multiple versions to this place in the compiler:

  1. Initially we thought we could cache the namespace adapter $compileNodes.
  2. Then we had the usecase where the root of the $compileNodes was a template directive with a template that is fetched slowly. So we added a check whether the content of the $compileNodes jqLite wrapper was changed to clear the cache (see When using svg directive with ngRepeat, the newly added element is not replaced with the directive template #8808 and cb73a37).
  3. Now we have the usecase where a child element of the $compileNodes is a template directive with a template that is fetched slowly. Right now there is no way to detect that there is a template load pending, so we need to clone the $compileNodes in every call to the linking function if the namespace is svg.

In summary:
We cannot cache the namespace adapted $compileNodes at all.

@tbosch tbosch closed this Oct 3, 2014
@tbosch tbosch deleted the fix/svg branch October 3, 2014 22:58
tbosch added a commit that referenced this pull request Oct 3, 2014
This fixes the case when a directive that uses `templateUrl`
is used somewhere in the children
of a transcluding directive like `ng-repeat`.

Fixes #9344
Related to #8808
Closes #9415
@tbosch
Copy link
Contributor Author

tbosch commented Oct 3, 2014

(Reviewed offline with @IgorMinar)

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