Ontouchstart / ng-Touchstart / UI-template


#1

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.

<md-button
ontouchstart="send({payload:mdown()})"
ontouchend="send({payload:mup()})">
</md-button>

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

I really need some help here.

Best Regards


#2

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


#5

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


#6

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


#7

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


#8

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