Angular4 popup not working?

Asked

Viewed 55 times

1

Guys, I have a problem at angle 4. I’m trying to use the component ng2-opd-popup. It installs right, but when I declare it in app.modules.ts it returns the following error:

ERROR in Error encountered resolving Symbol values statically. Calling Function 'makeDecorator', Function calls are not supported. Consider replacing the Function or lambda with a Reference to an Exported Function, resolving Symbol Ngmodule in C:/Mercurial/catalogonew/Project/Liera.Catalogo/Liera.Catalogo.UI.Angular2/node_modules/ng2-opd-popup/node_modules/@angular/core/src/Metadata/ng_module.d.ts, resolving Symbol Ngmodule in C:/Mercurial/catalogonew/Project/Liera.Catalogo/Liera.Catalogo.UI.Angular2/node_modules/ng2-opd-popup/node_modules/@angular/core/src/Metadata.d.ts, resolving Symbol Ngmodule in C:/Mercurial/catalogonew/Project/Liera.Catalogo/Liera.Catalogo.UI.Angular2/node_modules/ng2-opd-popup/node_modules/@angular/core/src/core.d.ts, resolving Symbol Ngmodule in C:/Mercurial/catalogonew/Project/Liera.Catalogo/Liera.Catalogo.UI.Angular2/node_modules/ng2-opd-popup/node_modules/@angular/core/index.d.ts, resolving Symbol Popupmodule in C:/Mercurial/catalogonew/Project/Liera.Catalogo/Liera.Catalogo.UI.Angular2/node_modules/ng2-opd-popup/Components/popup.module.d.ts, resolving Symbol Popupmodule in C:/Mercurial/catalogonew/Project/Liera.Catalogo/Liera.Catalogo.UI.Angular2/modules/ng2-opd-popup/Components/popup.module.ts

In the App.Module I’m implementing it as follows:

import {PopupModule} from 'ng2-opd-popup';
const appRoutes: Routes = [
  { path: '', component: HomeComponent },
  { path: 'login', component: LoginComponent },
  { path: 'detalhe/:id', component: DetalheComponent },  
  { path: 'busca/:sku', component: HomeComponent },
  { path: 'buscarefresh/:sku', component: HomeComponent },
  { path: 'buscacarro/:carro', component: HomeComponent },
  { path: 'autocadastro/:chave', component: CadastroComponent },  
  { path: 'carrinho', component: CarrinhoComponent },
  { path: 'pedido',component: PedidoComponent },
  { path: 'liberar-cadastro',component: LiberarCadastroComponent }
];

@NgModule({
  declarations: [
    AppComponent,
    HomeComponent,
    LoginComponent,
    BarComponent,
    DetalheComponent,
    CarrinhoComponent,
    PedidoComponent,
    CadastroComponent,
    LiberarCadastroComponent,
    AuthDirective
  ],
  imports: [
    RouterModule.forRoot(
      appRoutes
    ),
    BrowserModule,
    HttpModule,
    FormsModule,
    SelectModule,
    PopupModule.forRoot()
  ],
  providers: [ 
    BaseAddressService,
    HttpClientService,
    TokenService,
    AuthService,
    ItemService,
    FiltroService
  ],  
  bootstrap: [AppComponent]
})
export class AppModule { }

How can I solve this problem? I’ve looked at the file that was supposed to be wrong but I haven’t found anything that Angular might complain about.

  • Gabriel, I’m new to Angular4 (I’m taking a course now) and I’m using VS Code, which automatically imports the necessary modules. However, it is importing in this way "@angular/core/src/Metadata/ng_module", causing error already in the compilation. When I switch to "@angular/core" the build is successfully completed; check that this is not the cause of your problem.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.