相关疑难解决方法(0)

角度材料样式类不起作用

我正在使用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)

html javascript angular-material2 angular

19
推荐指数
5
解决办法
2万
查看次数

标签 统计

angular ×1

angular-material2 ×1

html ×1

javascript ×1