-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Inconsistent angular.element.scope() behaviour when using templateUrl in directive #5099
Comments
This seems to work as expected (without jQuery) with 1.2.8. But with newer versions of jQuery it seems to be an issue. Seems like it relates to jQuery's expandostore, and I'm not sure it's a good idea to hack around it, although it is unfortunate. I can look into a way to do this, but it might take some time. Maybe it would be worth getting the jQuery team looking at it, or something. |
On this line, Line 1529 in c894470
This seems to be coming from the Line 1676 in c894470
So this seems like a bug with replaceWith, I'm seeing if I can get some guidance from jQuery people on what to do about that |
Before this patch, with modern versions of jQuery being used, the element data cache was not being copied over into the new element when replacing an asynchronous directive's compile node with its template. This caused an issue where the element passed into a post link function's scope() method would return the incorrect scope. The test which is added passes regardless of the change in jQuery 1.10.2, which is currently checked into the tree, but fails without the change in jQuery 2.0.3. Fixes angular#5099
Before this patch, with modern versions of jQuery being used, the element data cache was not being copied over into the new element when replacing an asynchronous directive's compile node with its template. This caused an issue where the element passed into a post link function's scope() method would return the incorrect scope. The test which is added passes regardless of the change in jQuery 1.10.2, which is currently checked into the tree, but fails without the change in jQuery 2.0.3. Closes angular#5099
Before this patch, with modern versions of jQuery being used, the element data cache was not being copied over into the new element when replacing an asynchronous directive's compile node with its template. This caused an issue where the element passed into a post link function's scope() method would return the incorrect scope. The test which is added passes regardless of the change in jQuery 1.10.2, which is currently checked into the tree, but fails without the change in jQuery 2.0.3. Closes angular#5099
Before this patch, with modern versions of jQuery being used, the element data cache was not being copied over into the new element when replacing an asynchronous directive's compile node with its template. This caused an issue where the element passed into a post link function's scope() method would return the incorrect scope. The test which is added passes regardless of the change in jQuery 1.10.2, which is currently checked into the tree, but fails without the change in jQuery 2.0.3. Closes angular#5099
I think that's about ready ^_^ checkin-needed |
Works fine with jQuery 2.1.1 and Angular snapshot: Older Angular versions don't support jQuery 2.x. I'm closing this issue; please comment if I omitted something. |
Here's the example that demonstrates the issue. Scope ids should not match. However it works when using inline template.
It also works correctly when using jQuery v1.10.2 and templateUrl.
The text was updated successfully, but these errors were encountered: