Skip to content

docs(datepicker): add docs for custom calendar header #10543

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

Merged
merged 3 commits into from
Apr 10, 2018

Conversation

mmalerba
Copy link
Contributor

No description provided.

@mmalerba mmalerba added pr: needs review docs This issue is related to documentation target: patch This PR is targeted for the next patch release labels Mar 23, 2018
@mmalerba mmalerba added this to the 6.0 milestone Mar 23, 2018
@mmalerba mmalerba requested a review from jelbourn March 23, 2018 17:18
@mmalerba mmalerba requested a review from amcdnl as a code owner March 23, 2018 17:18
@googlebot googlebot added the cla: yes PR author has agreed to Google's Contributor License Agreement label Mar 23, 2018
@@ -287,6 +287,20 @@ export class MyApp {}

<!-- example(datepicker-formats) -->

#### Customizing the calendar header

The header section of the calendar (the part containing the view switcher and previous and next
Copy link
Member

Choose a reason for hiding this comment

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

Maybe not the right time to ask this question, but why an API that takes a component as an input? We don't have any APIs like that elsewhere in the library, instead using templates and/or content projection.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Content projection wasn't feasible because it would have had to be passed through several layers <mat-datepicker> --> <mat-datepicker-content> --> <mat-calendar>. A template may have been workable, but there's a fair chunk of logic that goes with the header so a component seemed cleaner. At some point I want to break the datepicker into a bunch of composable pieces, we may be able to change how this works at that point

Copy link
Member

@jelbourn jelbourn left a comment

Choose a reason for hiding this comment

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

LGTM

@jelbourn jelbourn added pr: lgtm action: merge The PR is ready for merge by the caretaker and removed pr: needs review labels Mar 27, 2018
@jelbourn
Copy link
Member

jelbourn commented Apr 6, 2018

@mmalerba can you rebase?

@mmalerba
Copy link
Contributor Author

mmalerba commented Apr 6, 2018

Done

@mmalerba mmalerba requested a review from devversion as a code owner April 9, 2018 17:13
@tinayuangao tinayuangao merged commit b472330 into angular:master Apr 10, 2018
@labyed
Copy link

labyed commented May 9, 2018

the header example is not working on docs, i got this error in stackblitz:
ERROR Error: StaticInjectorError(AppModule)[ExampleHeader -> DateAdapter]: StaticInjectorError(Platform: core)[ExampleHeader -> DateAdapter]: NullInjectorError: No provider for DateAdapter!

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge The PR is ready for merge by the caretaker cla: yes PR author has agreed to Google's Contributor License Agreement docs This issue is related to documentation target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants