0

I'm trying to use angular-particle library in my angular project.

I have done the implementation according to the documentation, imported ParticlesModule in the module file.

In HTML added <particles [style]="style" [width]="width" [height]="height" [params]="params"></particles>

in the TS file I have created params object with particle JSON and style object with CSS styles also width and height variables.

but when I compile the code I get the below error.

I really don't want to turn off IVY.

Is there a workaround that I can do to use this package or is there any alternative package that I can use to achieve similar animation?

compilation Error::

ERROR in node_modules/angular-particle/index.d.ts:3:22 - error NG6002: Appears in the NgModule.imports of AppModule, but could not be resolved to an NgModule class.

This likely means that the library (angular-particle) which declares ParticlesModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check if a newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library is expected to be compatible with Ivy.

3 export declare class ParticlesModule {

Angular Version:

Angular CLI: 9.1.15

Node: 10.16.3

OS: win32 x64

Angular: 9.1.13

Ivy Workspace: Yes

mandav
  • 51
  • 4
  • Have tried running ngcc before starting the app? Don't know if that works. – Silvermind Apr 09 '21 at 17:07
  • Yes, I have ngcc in postinstall script and also I have tried running it separately before executing ng serve. – mandav Apr 09 '21 at 17:29
  • for now, I have skipped using angular-particle and I'm directly using particle.js, although this has removed my blocker for now I would like to know if I can use angular-particlce. – mandav Apr 10 '21 at 06:09
  • You can try `ng-particles` library https://www.npmjs.com/package/ng-particles it uses tsParticles as core library (you can find documentation here: https://particles.js.org) – Caelan Jun 18 '21 at 23:02

0 Answers0