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

Commit b0ca519

Browse files
jbedardrodyhaddad
authored andcommitted
perf($compile): no longer need nodeType filter when setting $scope data
Closes #7887
1 parent 85b7731 commit b0ca519

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

src/ng/compile.js

+1-8
Original file line numberDiff line numberDiff line change
@@ -865,14 +865,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
865865
$linkNode.data('$' + name + 'Controller', instance);
866866
});
867867

868-
// Attach scope only to non-text nodes.
869-
for(var i = 0, ii = $linkNode.length; i<ii; i++) {
870-
var node = $linkNode[i],
871-
nodeType = node.nodeType;
872-
if (nodeType === 1 /* element */ || nodeType === 9 /* document */) {
873-
$linkNode.eq(i).data('$scope', scope);
874-
}
875-
}
868+
$linkNode.data('$scope', scope);
876869

877870
if (cloneConnectFn) cloneConnectFn($linkNode, scope);
878871
if (compositeLinkFn) compositeLinkFn(scope, $linkNode, $linkNode, parentBoundTranscludeFn);

0 commit comments

Comments
 (0)