After adding the ng2-opd-popup module on the app.module.ts page, some error appears in the corner

I tried to integrate Angular Popup Modal into my application, but it does not work. First I ran the npm command and then added a popup module in mine app.module.ts, but the browser showed some error. I am using 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 { }
+2
source share

Source: https://habr.com/ru/post/1678791/


All Articles