Angular 8 - problem to instantiate any primeng object by @ViewChild

UI Components for Angular
Post Reply
oruspay
Posts: 5
Joined: 26 Nov 2019, 13:40

30 Dec 2019, 21:38

I am trying to instantiate PrimeNG objects to control some actions through typescript but the error is occurring:

ERROR in ./src/app/modules/example/example.component.ts
Module not found: Error: Can't resolve 'primeng/primeng' in '/home/felipe/oruserv/angular/hybrid-ui/src/app/modules/example'


PrimeNG Version:
"primeflex": "^ 1.0.0",
"primeicons": "^ 2.0.0",
"primeng": "^ 9.0.0-rc.1"

Thanks

kasparov112000
Posts: 2
Joined: 28 Dec 2019, 18:30

02 Jan 2020, 02:22

try primeng/api instead of primeng/primeng

snel85
Posts: 1
Joined: 19 Jan 2020, 13:32

19 Jan 2020, 13:35

Hi,

I had the same issue. You need to change your import and make it more specific like this:

Code: Select all

import { DataViewModule } from 'primeng/dataview';
instead of this:

Code: Select all

import { DataViewModule } from 'primeng/primeng';
I guess that changed since primeng 9.0.0

xileck
Posts: 2
Joined: 08 Apr 2017, 16:37

28 Nov 2020, 16:27

Changing imports from:

Code: Select all

 import { DataViewModule } from 'primeng/primeng';
to :

Code: Select all

import { DataViewModule } from 'primeng';
Worked for me.

Post Reply

Return to “PrimeNG”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 12 guests