I have an Angular app that I want to use particles.js in however I have no clue how to add it and get it working.
(我有一个Angular应用程序,想在其中使用particles.js,但是我不知道如何添加它并使它正常工作。)
I've added it to the .angular-cli.json
(我已将其添加到.angular-cli.json)
"scripts": [
"../node_modules/particles.js/particles.js"
],
And I've imported it into my component
(我已经将它导入了我的组件)
import * as particlesJS from 'particles.js';
And attempted to initialize it using
(并尝试使用初始化它)
particlesJS.load('particles-js', 'assets/particles.json', function() {
console.log('callback - particles.js config loaded');
});
Has anyone got this working?
(有人有这个工作吗?)
ask by Steve Fitzsimons translate from so
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…