Home > Net >  Property 'picker' does not exist on type 'AppComponent'
Property 'picker' does not exist on type 'AppComponent'

Time:06-10

i am trying to make this picker but it says it doesent exits, does anyone know how to help me?

Code:
<mat-date-range-input [rangePicker]="picker">
    <input matStartDate placeholder="From Date">
    <input matEndDate placeholder="To Date">
  </mat-date-range-input>

<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>//error happens here

CodePudding user response:

This is a working example

  <mat-date-range-input [rangePicker]="picker">
    <input matStartDate placeholder="Start date">
    <input matEndDate placeholder="End date">
  </mat-date-range-input>
  <mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
  <mat-date-range-picker #picker></mat-date-range-picker>

CodePudding user response:

Your app.component.ts doesn't have a picker named variable

  • Related