Primeng: PrimeNG on NG4: Unexpected module 'DropdownModule' declared by the module 'AppModule'. Please add a @Pipe/@Directive/@Component annotation.

Created on 19 Jun 2017  路  1Comment  路  Source: primefaces/primeng


screenshot_12

I'm submitting a ...

[x ] bug report => Search github for a similar issue or PR before submitting

Plunkr Case (Bug Reports)
Bug repro on this plunkr: http://embed.plnkr.co/hC2WVwUg0wmLC4uGohEw/

Current behavior
As an example, I import { DropdownModule } in app.module.ts and add it to @NgModule declarations array as DropdownModule. Howewer, whenever, in any view, I use <p-dropdown></p-dropdown> selector, in the console, I'm notified of an error --- Unexpected module 'DropdownModule' declared by the module 'AppModule'. Please add a @Pipe/@Directive/@Component annotation.

Expected behavior
A decorator should be added and there should be no more error spit out in the console.

Minimal reproduction of the problem with instructions
Bug repro on this plunkr: http://embed.plnkr.co/hC2WVwUg0wmLC4uGohEw/

What is the motivation / use case for changing the behavior?
It'd work as expected on NG4.

Please tell us about your environment:
Win10 Pro, Webstorm 2017.1.3

  • Angular version: ~4.1.2

  • PrimeNG version: ^4.1.0-rc.2

  • Browser: latest Chrome version, possibly --- all others.

  • Language: TS ~2.2.2

  • Node (for AoT issues): 6.10.3

Most helpful comment

SOLVED.

The modules should've been placed into imports array of NgModule instead of declarations. Sorry about the confusion there.

>All comments

SOLVED.

The modules should've been placed into imports array of NgModule instead of declarations. Sorry about the confusion there.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mitosandov picture mitosandov  路  3Comments

papiroca-tm picture papiroca-tm  路  3Comments

garethlewis picture garethlewis  路  3Comments

KannanMuruganmony picture KannanMuruganmony  路  3Comments

philly-vanilly picture philly-vanilly  路  3Comments