我想在Angular 7中实现粒子JS。我遵循Xamarin Live Player的步骤。即使是关于Angular 7的评论,当我想将粒子导入ts文件时,它也说它找不到具有该名称的模块。我必须新建一个模块,还是其他地方出错?
这是我的代码:
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>
答案 0 :(得分:0)
对“ Angular”使用“ angular-particle”
获得