我已将角度版本 8 更新为角度 9,并将角度材料更新为版本 9,但它无法正常工作且未显示任何错误。如何修复它。
这是代码材料模块
import { NgModule } from '@angular/core';
import {MatButtonModule} from '@angular/material/button';
@NgModule({
declarations: [],
imports: [
MatButtonModule
]
})
export class MaterialModule { }
应用组件.html
<h3>Stroked Buttons</h3>
<div class="example-button-row">
<button mat-stroked-button>Basic</button>
<button mat-stroked-button color="primary">Primary</button>
<button mat-stroked-button color="accent">Accent</button>
<button mat-stroked-button color="warn">Warn</button>
<button mat-stroked-button disabled>Disabled</button>
<a mat-stroked-button routerLink=".">Link</a>
</div>
应用程序模块
import { BrowserModule } from '@angular/platform-browser';
import { NgModule, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { BrowserAnimationsModule } from '@angular/platform browser/animations';
import { MaterialModule } from './angular-material/material/material.module';
import { MatButtonModule } from '@angular/material/button';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
AppRoutingModule,
BrowserAnimationsModule,
MaterialModule,
],
providers: [],
bootstrap: [AppComponent],
schemas: [ CUSTOM_ELEMENTS_SCHEMA ]
})
export class AppModule { }