I have integrated ng-particles into my Angular project by installing it with npm i ng-particles and adding
app.ts
import { Container, Main } from 'ng-particles';
export class AppComponent{
id = "tsparticles";
/* Using a remote URL or JavaScript object for configuration */
particlesUrl = "http://foo.bar/particles.json";
/* Configuring various particle options */
particlesOptions = {
// Particle option values
};
particlesLoaded(container: Container): void {
console.log(container);
}
particlesInit(main: Main): void {
console.log(main);
// Adding custom presets or shapes here
}
}
app.module.ts
import {NgParticlesModule} from "ng-particles";
import {NgModule} from "@angular/core";
@NgModule({
declarations: [
/* AppComponent */
],
imports: [
/* other imports */ NgParticlesModule /* Importing NgParticlesModule */
],
providers: [],
bootstrap: [
/* AppComponent */
]
})
export class AppModule {
}
app.html
<ng-particles [id]="id" [options]="particlesOptions" (particlesLoaded)="particlesLoaded($event)" (particlesInit)="particlesInit($event)"></ng-particles>
package.json
"ng-particles": "^2.2.2",
Following the instructions from https://www.npmjs.com/package/ng-particles, I encountered multiple errors while running https://i.stack.imgur.com/tgWdH.png
https://i.stack.imgur.com/ibgrO.png
What am I missing?
Providing version details https://i.stack.imgur.com/6gRXU.png