我尝试在我的应用中集成Angular Popup Modal,但它无效。最初我运行npm命令然后在我的app.module.ts
中添加了弹出模块,但浏览器显示了一些错误。我正在使用Angular 4。
"Uncaught Error: Unexpected value '[object Object]' imported by the module 'AppModule'. Please add a @NgModule annotation."
app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { HttpModule } from '@angular/http';
import {PopupModule} from 'ng2-opd-popup';
import { AppComponent } from './app.component';
import { DashboardComponent } from './dashboard/dashboard.component';
import { BookingComponent } from './booking/booking.component';
import { BookingService } from './booking/booking.service';
import { AppRoutingModule } from './app-routing/app-routing.module';
@NgModule({
declarations: [
AppComponent,
DashboardComponent,
BookingComponent
],
imports: [
BrowserModule,
HttpModule,
AppRoutingModule,
PopupModule.forRoot(),
],
providers: [ BookingService ],
bootstrap: [ AppComponent ]
})
export class AppModule { }