Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

184
Visualizações
Change header of an inline datepicker angular material

To change the header of a datepicker in angular material we use [calendarHeaderComponent] e.g

<mat-form-field>
  <mat-label>Date</mat-label>
  <input formControlName="date" matInput [matDatepicker]="picker" />
  <mat-datepicker-toggle matSuffix [for]="picker">
    <mat-icon matDatepickerToggleIcon svgIcon="calendar_day"></mat-icon>
  </mat-datepicker-toggle>
  <mat-datepicker color="primary" [calendarHeaderComponent]="datePickerHeader" #picker></mat-datepicker>
</mat-form-field>

To get the datepicker inline we use mat-calendar directly

  <mat-calendar [(selected)]="date"></mat-calendar>

The challenge is that If I try to use calendarHeaderComponent directive on this component it throws error that this attribute is not allowed here. How can I solve this?

about 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

Assuming customDatePickerHeader is your custom header component. Try binding as follows:

<mat-calendar [headerComponent]="customDatePickerHeader" [(selected)]="date"></mat-calendar>

I'd have referenced a documentation but not sure it's easy to find one for the inline mat-calendar component. Will edit post if I manage to find it.

about 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda