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

Commit

Permalink
perf($compile): use static jquery data method to avoid creating new i…
Browse files Browse the repository at this point in the history
…nstances
  • Loading branch information
jbedard authored and petebacondarwin committed Nov 1, 2015
1 parent 5b4713e commit 55ad192
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ng/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -2525,7 +2525,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
// Copy over user data (that includes Angular's $scope etc.). Don't copy private
// data here because there's no public interface in jQuery to do that and copying over
// event listeners (which is the main use of private data) wouldn't work anyway.
jqLite(newNode).data(jqLite(firstElementToRemove).data());
jqLite.data(newNode, jqLite.data(firstElementToRemove));

// Remove data of the replaced element. We cannot just call .remove()
// on the element it since that would deallocate scope that is needed
Expand Down

0 comments on commit 55ad192

Please sign in to comment.