-
Notifications
You must be signed in to change notification settings - Fork 6.8k
feat(datepicker): add opened input binding #8098
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(datepicker): add opened input binding #8098
Conversation
src/lib/datepicker/datepicker.ts
Outdated
@Input() | ||
get opened(): boolean { return this._opened; } | ||
set opened(value: boolean) { | ||
const shouldOpen = coerceBooleanProperty(value); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you're not assigning the shouldOpen
anywhere, you don't really need to coerce it.
src/lib/datepicker/datepicker.ts
Outdated
set opened(value: boolean) { | ||
const shouldOpen = coerceBooleanProperty(value); | ||
|
||
if (shouldOpen) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You could shorten this one down with a ternary: shouldOpen ? this.open() : this.close()
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Got a broken test in Safari
|
@andrewseguin This is related to the internationalization APIs of the browser. Since the tests didn't run before (at all) the issue didn't show up yet. Might need to investigate whether the browser has the |
2bf77c7
to
a38f138
Compare
Safari doesn't support the Intl API, I would just skip that test on Safari |
@mmalerba Yeah. I just used that |
4e564a2
to
3bf9d3f
Compare
* Adds support for the `opened` input binding. Closes angular#8094
3bf9d3f
to
d623f01
Compare
* Adds support for the `opened` input binding. Closes angular#8094
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
opened
input binding.Closes #8094