我正在使用Angular Material将日期选择器添加到我的应用程序中。由于某种原因,角材料没有应用原始的角材料样式。
它如何在我的应用程序中显示:
它应该如何显示:
我做了什么:
npm install --save @angular/material @angular/cdk
npm install --save @angular/animations
// Added this to the Angular Module whose components require the date picker
import {MatNativeDateModule, MatDatepickerModule} from "@angular/material";
//Added this in the root style.css file for the entire app
@import "~@angular/material/prebuilt-themes/indigo-pink.css";
Run Code Online (Sandbox Code Playgroud)
我不确定我做错了什么。
更新:
模块代码:
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {RouterModule} from "@angular/router";
import {ProposalListComponent} from './components/proposal-list.component';
import {ProposalDetailComponent} from './components/proposal-detail.component';
import {ProposalEditComponent} from './components/proposal-edit.component';
import {ReactiveFormsModule} from "@angular/forms"; …Run Code Online (Sandbox Code Playgroud)