【发布时间】:2018-04-25 11:42:44
【问题描述】:
我正在开发 Angular 4.4.6 应用程序,我想使用很棒的插件 AOS 实现一些滚动动画
我的代码:
app.component.ts
import * as AOS from 'aos';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
encapsulation:ViewEncapsulation.None
})
export class AppComponent implements OnInit {
ngOnInit(){
AOS.init();
}
}
app.component.html
<div class="box" data-aos="slide-left">
<img src="assets/imgs/seo.png" alt="">
</div>
angulr.cli.json
"styles": [
"../node_modules/aos/dist/aos.css",
"../node_modules/animate.css/animate.min.css",
"styles.scss"
],
"scripts": [
"../node_modules/jquery/dist/jquery.js",
"../node_modules/aos/dist/aos.js"
],
我在这里尝试过没有希望的答案 https://stackoverflow.com/a/44808496/4183947
注意:我的控制台没有错误。
【问题讨论】:
标签: jquery angular jquery-plugins angular-animations