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

Commit 645625c

Browse files
committed
perf($compile): refactor publicLinkFn to simplify the code and use 'for in' loop
1 parent e822e90 commit 645625c

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

src/ng/compile.js

+2-7
Original file line numberDiff line numberDiff line change
@@ -889,13 +889,8 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
889889
: $compileNodes;
890890

891891
if (transcludeControllers) {
892-
var names = Object.keys(transcludeControllers);
893-
var i = names.length;
894-
var name;
895-
896-
while (i--) {
897-
name = names[i];
898-
$linkNode.data('$' + name + 'Controller', transcludeControllers[name]);
892+
for (var controllerName in transcludeControllers) {
893+
$linkNode.data('$' + controllerName + 'Controller', transcludeControllers[controllerName]);
899894
}
900895
}
901896

0 commit comments

Comments
 (0)