在app.module.ts页面中添加ng2-opd-popup模块后,在angular4中出现了一些错误

时间:2017-06-15 13:24:03

标签: angular

我尝试在我的应用中集成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 { }

0 个答案:

没有答案