how can i use it in a template?
MitkoTschimev opened this issue · comments
Mitko Tschimev commented
Hi ;)
Is there something like a helper for handlebars?
Or how can i register a tap to an element.
Best regards
Chris Wessels commented
Hi @tfiwm,
In order to attach touch behaviour to an element, you need have that element represented by a Ember.View object. You can then attach behaviour to it like so:
import Ember from 'ember';
export default Ember.View.extend({
hammerOptions: {
swipe_velocity: 0.5
},
gestures: {
swipeLeft: function (event) {
// do something like send an event down the controller/route chain
return false; // return `false` to stop bubbling
}
}
});
Look here for help with understanding views: http://emberjs.com/guides/views/
Chris