diff --git a/src/ng/compile.js b/src/ng/compile.js index ba0336a4b4d5..56a4bc0c385a 100644 --- a/src/ng/compile.js +++ b/src/ng/compile.js @@ -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