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

Issue #1941 - This fixes an issue that can break $observe when using a directive with a templateUrl. #3408

Closed
wants to merge 1 commit into from

Conversation

slundberg
Copy link

http://plnkr.co/edit/xJNt918gEpuXR026VuZB?p=preview illustrates the issue that this pull request addresses.

When a node is cloned because the beforeTemplateLinkNode !== beforeTemplateCompileNode condition was met, then this would cause the link functions to create a new attrs object, but by setting their last argument to "true" below we force them to keep the same attrs object. Without this flag the $$observers is put on the afterTemplateNodeLinkFn version of attrs and the $set is called on the beforeTemplateNodeLinkFn version of the attrs whenever we make a cloned linkNode above, thus breaking $observe. See github issue #1941

I have not contributed to angular before so I imagine some testing and review is needed but I wanted to offer this patch (which resolved the problem) as a starting point.

Thanks.

…rve when using a templateUrl for a directive. http://plnkr.co/edit/xJNt918gEpuXR026VuZB?p=preview illustrates the issue that was fixed
@ghost ghost assigned btford Oct 2, 2013
@btford
Copy link
Contributor

btford commented Oct 2, 2013

As far as I can tell, this has already been fixed in master.

Here's a plunker with a recent build from our CI server: http://plnkr.co/edit/fB4uC2Oymka2pEbZ7gbw?p=preview

If I'm mistaken, let me know and I'd be happy to reopen it.

@btford btford closed this Oct 2, 2013
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.

2 participants