Page 1 of 1

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

Posted: 30 Dec 2019, 21:38
by oruspay
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

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

Posted: 02 Jan 2020, 02:22
by kasparov112000
try primeng/api instead of primeng/primeng

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

Posted: 19 Jan 2020, 13:35
by snel85
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

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

Posted: 28 Nov 2020, 16:27
by xileck
Changing imports from:

Code: Select all

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

Code: Select all

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