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

feat(getControllers): allow objects for require #8401

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
8 changes: 4 additions & 4 deletions src/ng/compile.js
Original file line number Diff line number Diff line change
Expand Up @@ -1441,10 +1441,10 @@ function $CompileProvider($provide, $$sanitizeUriProvider) {
require, directiveName);
}
return value;
} else if (isArray(require)) {
value = [];
forEach(require, function(require) {
value.push(getControllers(directiveName, require, $element, elementControllers));
} else if (isArray(require) || isObject(require)) {
value = isArray(require) ? [] : {};
forEach(require, function(require, key) {
value[key] = getControllers(directiveName, require, $element, elementControllers);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you also forgot to add the key parameter to the forEach callback

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops, yeah that's why you don't make PR's with github edits. I ran the unit tests locally with key fix and had no errors

});
}
return value;
Expand Down