Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot find name "MAT_DATE_LOCALE" with Material.angular Datepicker

According to the documentation https://material.angular.io/components/datepicker/overview here to set the locale code to one you want you provide it by putting

providers: [
    {provide: MAT_DATE_LOCALE, useValue: 'en-GB'},
]

But then my app won't compile as it tells me it cannot find the name MAT_DATE_LOCALE. Am I missing something here as in I have to define it myself? Though, I can't think of where to put it as it's all in the module class.

like image 796
Epicity Avatar asked Oct 26 '17 11:10

Epicity


1 Answers

In Angular 9 do the import:

 { MAT_DATE_LOCALE } from '@angular/material/core';

I suppose that in the import must be entered specified path import. Optimization stuff.

Sorry for my english.

From Angular 9, no component can be imported through @angular/material. You are to use the individual secondary entry-points, such as @angular/material/button.

Top New Features of Angular 9

like image 165
Joan Sanchez Avatar answered Sep 28 '22 03:09

Joan Sanchez