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

Commit

Permalink
perf($compile): no longer need nodeType filter when setting $scope data
Browse files Browse the repository at this point in the history
Closes #7887
  • Loading branch information
jbedard authored and rodyhaddad committed Jul 1, 2014
1 parent 85b7731 commit b0ca519
Showing 1 changed file with 1 addition and 8 deletions.
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

0 comments on commit b0ca519

Please sign in to comment.