0
votes

I am trying to import 'PopupModule' Module from 'ng2-opd-popup' to my app. Webpack compiles fine, but I get this error in the browser and nothing loads:

Unexpected value '[object Object]' imported by the module 'AppModule'. Please add a @NgModule annotation.

In App.module.ts file i am trying to add:

import { PopupModule } from 'ng2-opd-popup'; 

@NgModule({
  declarations: [ ],
  imports: [
    PopupModule.forRoot()
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

If i remove this module then everything works fine.

I am using angular 4.

Versions:

  • @angular/cli: 1.4.5
  • node: 6.9.1
  • os: win32 x64
  • @angular/common: 4.4.6
  • @angular/compiler: 4.4.6
  • @angular/core: 4.4.6
  • @angular/cli: 1.4.5
  • @angular/compiler-cli: 4.4.6
  • typescript: 2.3.4

Any ideas?

2

2 Answers

0
votes

I have also face this issue , I have tried to work with downgraded option but still I was not able to work in shared module .

I have install other package and it works

https://www.npmjs.com/package/ng2-modal

0
votes

Go to inside your ng2-opd-popup folder in node-modules folder and delete the node_modules folder inside there (inside ng2-opd-popup folder). It is not needed. I have also faced this issue and so it worked without the folder.