angular - Cannot find namespace NodeJS when using NodeJS.Timer in Ionic 2 -
i attempting use code found on https://github.com/bevacqua/dragula/issues/289#issuecomment-277143172 ionic project.
when run code error cannot find namespace 'nodejs'
, error refers touchtimeout: nodejs.timer;
how can adapt code below make nodejs.timer
line work?
import { directive, elementref, hostlistener } '@angular/core'; @directive({ selector: '[delaydraglift]' }) export class delaydragliftdirective { dragdelay: number = 200; // milliseconds draggable: boolean = false; touchtimeout: nodejs.timer; @hostlistener('touchmove', ['$event']) // @hostlistener('mousemove', ['$event']) onmove(e: event) { if (!this.draggable) { e.stoppropagation(); cleartimeout(this.touchtimeout); } } @hostlistener('touchstart', ['$event']) // @hostlistener('mousedown', ['$event']) ondown(e: event) { this.touchtimeout = settimeout(() => { this.draggable = true; }, this.dragdelay); } @hostlistener('touchend', ['$event']) // @hostlistener('mouseup', ['$event']) onup(e: event) { cleartimeout(this.touchtimeout); this.draggable = false; } constructor(private el: elementref) { } }
Comments
Post a Comment