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

feat($compile): support omitting required controller name if same as the local name #14513

Closed

Conversation

gkalpak
Copy link
Member

@gkalpak gkalpak commented Apr 25, 2016

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Feature

What is the current behavior? (You can also link to an open issue here)
You have to explicitly specify the required controller's name, even if it's the same with the local name used to bind to the requiring controller (unlike how scope: {...} works, for example).

What is the new behavior (if this is a feature change)?
require: {someDir: '?^someDir'} can be shortened as require: {someDir: '?^'}.

Does this PR introduce a breaking change?
No

Please check if the PR fulfills these requirements

…the local name

Basically, making `require: {someDir: '?^someDir'}` equivalent to `require: {someDir: '?^'}`.
return {
restrict: 'E',
scope: {},
require: { parent: '^', sibling: '' },
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps worth checking "optional" require too?

Copy link
Contributor

Choose a reason for hiding this comment

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

And ^^

Copy link
Member Author

Choose a reason for hiding this comment

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

I added more checks 😉

@petebacondarwin
Copy link
Contributor

LGTM

@gkalpak gkalpak closed this in 0780666 Apr 28, 2016
gkalpak added a commit that referenced this pull request Apr 28, 2016
…the local name

Basically, making `require: {someDir: '?^someDir'}` equivalent to `require: {someDir: '?^'}`.

Closes #14513
@gkalpak gkalpak deleted the feat-compile-require-object-shorthand branch April 28, 2016 07:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants