0

I want to implement particles JS in Angular 7. I followed the stpes of this question. Even the comment of something about Angular 7 When I want to import the particles in my ts file, it says, that it can't find a module with that name. Must I make a new module or is the mistake anywhere else?

Here my Code:

TS:

import { Component, OnInit } from '@angular/core';
import { ParticlesConfig } from '../../assets/data/particles';

declare var particlesJS: any;

@Component({
  selector: 'home',
  templateUrl: './home.component.html',
  styleUrls: ['./home.component.css']
})
export class HomeComponent implements OnInit {

  constructor() { }

  ngOnInit() {
    particlesJS('particles-js', ParticlesConfig, function() {
      console.log('callback - particles.js config loaded');
    });
  }

}

HTML:

<div class="box" id="particles-js">
  <div class="title">Particles Works!</div>
</div>
1

1 Answer 1

0

Use "angular-particle" for Angular

It's implementation(documentation) is available at https://www.npmjs.com/package/angular-particle

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.