Ontouchstart / ng-Touchstart / UI-template


Hello Guys.

I'm new in the node red game.
I'm currently have problems with an angular js directive. I tried to install and make ngtouch work, but without luck.
I also tried angular-gestures, no luck eighter.

Then i managed to get ontouchstart to fire a function when clicking a md-button. The problem is that ontouchstart is not a angularjs directive, thus it will not update my callback function and send a new msg.payload.

I would like to send 1 or 0 as my payload message. touchstart should send 0, and touch end should send 1. How do i fix this?

Here is what i have so far.


var value = "hello world";
this.scope.mdown = function() { return "0" }
this.scope.mup = function() { return "1" }

I really need some help here.

Best Regards


ngTouch is already built in but only adds swipe left and swipe right. ngClick handles the basic click and touch.


But i need a ngTouchstart + ngtouchend, or touchpressed? How do i do that?


Please don't "bump" the thread every two hours. If someone knows the answer when they read the forum they will post an answer


I managed to find a way around the problem. I used jQuery to "simulate" mousedown and mouseup. Now it works.


Can I have the answear? I have the same problem..


could you please share your solution?


Really keen to know the answer here - I have the same frustrating problem

My similar code issue is below which passes the a string to the exec node on the RPI when the button is pressed, and when it is released..:

    this.scope.mdown = function() { return "python /home/pi/....turn something on"; }
    this.scope.mup = function() { return "python /home/pi/....turn something off"; }
    ng-touchend   = "send({payload:mup()})"
    ng-touchstart = "send({payload:mdown()})"
My Action Button


Try the following solution: Momentary button on Dashboard


:grinning: worked very well! Thank you!