我在我的项目中安装了棱角材料,而这不是加载。
我尝试将样式表导入到全局Style.css中。
重新启动服务器
但角质层材料并没有更新。
我一点线索都没有。
下面我也添加了我的Package.Json文件
我的HTml代码
<mat-form-field>
<textarea MatInput rows="6" [(ngModel)]="valueEntered"></textarea>
</mat-form-field>
<hr />
<button (click)="onSave()">Save</button>
<p>{{ newPost }}</p>应用程序模块代码
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { postCreateComponent } from './posts/post-create/post-create.component';
import { FormsModule } from '@angular/forms';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import {MatInputModule} from '@angular/material/input';
@NgModule({
declarations: [
AppComponent,
postCreateComponent
],
imports: [
BrowserModule,
AppRoutingModule,
FormsModule,
BrowserAnimationsModule,
MatInputModule
],
exports: [
BrowserModule,
AppRoutingModule,
FormsModule,
BrowserAnimationsModule,
MatInputModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }包Json文件
"dependencies": {
"@angular/animations": "~13.2.0",
"@angular/cdk": "^13.3.9",
"@angular/common": "~13.2.0",
"@angular/compiler": "~13.2.0",
"@angular/core": "~13.2.0",
"@angular/forms": "~13.2.0",
"@angular/material": "^13.3.9",
"@angular/platform-browser": "~13.2.0",
"@angular/platform-browser-dynamic": "~13.2.0",
"@angular/router": "~13.2.0",
"rxjs": "~7.5.0",
"tslib": "^2.3.0",
"zone.js": "~0.11.4"
},发布于 2022-06-14 18:57:00
应该做ng add @angular/material,并增加NgModule、MatFormFieldModule和BrowserAnimationsModule的进出口。
发布于 2022-09-26 10:26:41
我只注意到一件事,以防其他人错过它:你的HTML中的"matInput“需要是camel大小写"MatInput”。
https://stackoverflow.com/questions/72621743
复制相似问题