Saturday, March 18, 2017

Mobile events like tap, swipe with emberjs

Leave a Comment

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?

2 Answers

Answers 1

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.

Answers 2

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.

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment