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

perf($compile): remove no longer need nodeType filter when setting $scope data #7887

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions src/ng/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -865,14 +865,7 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
$linkNode.data('$' + name + 'Controller', instance);
});

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

if (cloneConnectFn) cloneConnectFn($linkNode, scope);
if (compositeLinkFn) compositeLinkFn(scope, $linkNode, $linkNode, parentBoundTranscludeFn);
Expand Down