我开始使用Angular 5和Angular Material进行一个非常简单的项目。
IntelliJ无法识别Angular Material HTML标记:
import {BrowserModule} from '@angular/platform-browser';
import {NgModule} from '@angular/core';
import {AppComponent} from './app.component';
import {CoreModule} from "@app/core";
import {SharedModule} from "@app/shared";
AppModule
导入SharedModule
:
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
CoreModule,
SharedModule,
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
哪些导入和导出Angular Material相关模块:
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {ReactiveFormsModule} from "@angular/forms";
import {BrowserAnimationsModule} from "@angular/platform- browser/animations";
import {MatToolbarModule} from "@angular/material";
import {NgReduxModule} from "@angular-redux/store";
@NgModule({
imports: [
CommonModule,
ReactiveFormsModule,
BrowserAnimationsModule,
MatToolbarModule,
NgReduxModule,
],
declarations: [],
exports: [
CommonModule,
ReactiveFormsModule,
BrowserAnimationsModule,
MatToolbarModule,
NgReduxModule,
]
})
export class SharedModule { }
答案 0 :(得分:0)
有时未正确安装开发依赖项。
试试npm i --only=dev