Ninja Turtle
Ninja Turtle

Reputation: 1373

Getting Error: 'mat-date-range-picker-actions' is not a known element

I want to add action buttons in my material date range picker. So i added this code given in documentation on link below

Documentation link: Date picker actions

<mat-date-range-picker #picker [touchUi]="true"> <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>

But when i run application i am getting error: 'mat-date-range-picker-actions' is not a known element

I have also imported MatDatepickerModule and MatNativeDateModule still getting this error. Without action buttons it is working fine,

Upvotes: 1

Views: 2813

Answers (1)

Ninja Turtle
Ninja Turtle

Reputation: 1373

Got it working after updating Angular material version. Since date-picker-action-buttons were added in version 11.1.0 and i was using version 10.2.2

It working after updating material version using these commands

npm install @angular/cdk@latest
npm install @angular/material@latest
npm install @angular/material-moment-adapter@latest

Upvotes: 3

Related Questions