这是我的 app.module 我尝试在 material.angular.io 中完成整个指令
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { AppComponent } from './app.component';
import { BrandComponent } from './brand/brand.component';
import { AlertModule } from 'ngx-bootstrap';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
import {MatButtonModule, MatCheckboxModule} from '@angular/material';
import 'hammerjs';
@NgModule({
declarations: [
AppComponent,
BrandComponent,
BrowserAnimationsModule,
MatButtonModule,
MatCheckboxModule
],
imports: [
BrowserModule,
AlertModule.forRoot(),
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
我应该怎么处理这个错误
最佳答案
将您的模块移动到您的导入数组,声明用于声明您的组件
imports: [
BrowserAnimationsModule,
MatButtonModule,
MatCheckboxModule
BrowserModule,
AlertModule.forRoot(),
],
关于angular - 由模块 'BrowserAnimationsModule' 声明的意外模块 'AppModule' 。请添加@Pipe/@Directive/@Component 注解,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56045070/