【发布时间】:2019-04-10 20:47:43
【问题描述】:
嘿,我试图在我的 Angular 应用程序中使用 Waypoints.js。我似乎无法让它工作
angular-cli.js
"scripts": [
"../node_modules/waypoints/lib/noframework.waypoints.min.js"
]
app.component.ts
import { Component, OnInit } from '@angular/core';
declare var Waypoint: any;
export class OurTechnologyComponent implements OnInit {
constructor() {}
ngOnInit() {
//waypoints
const grinner = new Waypoint({
element: document.querySelector('.tech-section'),
handler: function () {
alert('hello');
}
});
}
任何帮助将不胜感激
谢谢!
编辑
我已经安装了 Waypoints Types 并导入了它import * as Waypoint from 'waypoints';
收到错误[ts] file pathtofolder/@types/waypoints/index.d.ts is not a module
【问题讨论】:
-
你能解决这个问题吗?
标签: javascript angular typescript