Import error PopupModule.forRoot ()

I have an angular 2 working project. I need to create a popup to populate the details in the table. After clicking the button, I want to have a pop-up window in which the user can enter data and send. For this, I am trying to use the ng2-opd-popupangular 2 component . But it throws me the following error when I added PopupModule.forRoot()in importsof @NgModuleto my file app.module.ts. I installed it using npm install ng2-opd-popup.

vendor.9f5a936 .... js: 253
 Uncaught SyntaxError {_nativeError: Error: Unexpected value "Object object" imported by the "AppModule" module in SyntaxError.Base ...}

Any help would be greatly appreciated. By the way, I follow this link for the popup component, and I use webpack.

Part of the app.module.ts file:

import { BrowserModule } from '@angular/platform-browser';
import { FormsModule }    from '@angular/forms';
import { HttpModule } from '@angular/http';
import { AppComponent } from './app.component';
import { AgGridModule } from 'ag-grid-ng2/main';
import { PopupModule } from 'ng2-opd-popup';

@NgModule({
    imports: [
        BrowserModule,
        FormsModule,
        HttpModule,
        AgGridModule.forRoot(),
        PopupModule.forRoot(),
    ],
    declarations: [
        AppComponent,
    ],
+4
source share
1 answer

I had the same problem, you need to go into your ng2-opd-popup folder and delete the node_modules folder there. He's not needed. after that everything works fine.

+1
source

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


All Articles