Angular Material报错Error: MatDatepicker: No provider found for DateAdapter. You must import one of th
2020-07-20 04:17
1881 查看
1、新建项目,安装npm依赖后,
ng add @angular/material
配置npm和添加一起的命令:
npm i --s @angular/material @angular/cdk @angular/animations
问题1:
Error: MatDatepicker: No provider found for DateAdapter. You must import one of the following modules at your application root: MatNativeDateModule, MatMomentDateModule, or provide a custom implementation.
原因: MatDatepicker依赖于MatNativeDateModule,这两个模块需要一起引入
解决:
import {MatDatepickerModule} from '@angular/material/datepicker'; import { MatNativeDateModule } from '@angular/material/core';
相关文章推荐
- At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs d
- INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded
- No qualifying bean of type [org.apache.solr.client.solrj.SolrServer] found for dependency: expected
- springMVC返回json格式数据报错:No converter found for return value of type: class java.util.HashMap
- No qualifying bean of type [..] found for dependency
- java.lang.IllegalArgumentException: No converter found for return value of type: class
- "Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions.".
- No content provider found for permission revoke:
- No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClie
- DateTimePicker 控件出现 "You must be in ShowCheckbox mode to set to this date" 的错误
- Failed to import pydot. You must install pydot and graphviz for pydotprint to work
- 解决ntpdate error: no server suitable for synchronization found
- Maven报错 解决方案。ERROR: No goals have been specified for this build. You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id
- Spring MVC No converter found for return value of type
- 解决java.lang.IllegalArgumentException: No converter found for return value of type: class java.uvvvvv
- ntpdate同步时间时错误: no server suitable for synchronization found
- java.lang.IllegalArgumentException: No converter found for return value of type
- 解决虚拟机中使用ntpdate报错:ntpdate[46700]: no server suitable for synchronization found
- 使用ntpdate更新linux时间的时候出现 no server suitable for synchronization found解决办法
- No qualifying bean of type [XXX.XXX] found for dependency 解决方法