IntelliJ无法识别Angular Material HTML标记

时间:2018-04-17 18:15:57

标签: angular intellij-idea jetbrains-ide

我开始使用Angular 5和Angular Material进行一个非常简单的项目。

IntelliJ无法识别Angular Material HTML标记: IntelliJ won't recognize Angular Material HTML tags

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 { }

1 个答案:

答案 0 :(得分:0)

有时未正确安装开发依赖项。

试试npm i --only=dev