Tagged: angular material
February 23, 2021 at 11:55 am #671798
I use MyEclipse to build an Angular 10 application which uses Angular material.
In this application, I have a component template using a date range picker as presented here:
I have the exact same code in my app (excerpt below):
<mat-form-field appearance="fill"> <mat-label i18n>Validity period</mat-label> <mat-date-range-input [rangePicker]="validityPeriodPicker"> <input matStartDate formControlName="accountStartDate"> <input matEndDate formControlName="accountEndDate"> </mat-date-range-input> <mat-datepicker-toggle matSuffix [for]="validityPeriodPicker"></mat-datepicker-toggle> <mat-date-range-picker #validityPeriodPicker> <mat-date-range-picker-actions> <button mat-button matDateRangePickerCancel>Cancel</button> <button mat-raised-button color="primary" matDateRangePickerApply>Apply</button> </mat-date-range-picker-actions> </mat-date-range-picker> </mat-form-field>
I cannot compile since I have the following error on tag :
‘mat-date-range-picker-actions’ is not a known element:
If I remove this tag, it compiles.
Please tell me how to fix this, as my code is exactly the same as the sample code provided by Angular.February 23, 2021 at 11:27 pm #671809
It looks like you need to update the Angular Material version for the actions to work.
Please see similar report here and check if updating the Material version helps : https://stackoverflow.com/questions/66132625/getting-error-mat-date-range-picker-actions-is-not-a-known-element
Genuitec SupportFebruary 24, 2021 at 4:40 am #671814
Thanks, I have updated the required librairies and it compiles fine now.