Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mobile events like tap, swipe with emberjs

Is there any prior art/literature around how to deal with touch events on mobile in an emberjs app?

The most common one is a tap event but I cant find anything which discusses it in the context of an emberjs application.

Can using jquery just work? There is jquery mobile as well but I am concerned integrating that with ember might open a different can of worms.

Ember has support for touchEvents but then one still has to do work to simulate a tap, swipe or pinch event for instance.

Thoughts? How are people doing mobile apps using Emberjs?

like image 641
Rajat Avatar asked Feb 11 '17 17:02

Rajat


2 Answers

You should check out ember-hammertime and ember-gestures as examples of some community approaches. Also look for 'touch' on ember-observer

You have to think of everything as touch now, it's not really a mobile app issue anymore.

like image 151
sheriffderek Avatar answered Nov 09 '22 23:11

sheriffderek


Just use closure actions. Generally I would not rely on jQuery events. However I don't think tap is a real event. Well, most devices trigger onclick when you tap. But you can attach any event:

<div ontouchstart={{action 'foo'}}>foo</foo>

If you want to do more complex things consider to build a component for it.

like image 42
Lux Avatar answered Nov 10 '22 00:11

Lux