In my app using Emberjs, every action gets triggered 3 times on a single click.
For example with the following template and view:
Template:
<button {{action "removeFoo"}}>remove</button>
View with click handler:
listsView = Ember.View.create({
templateName: 'lists',
removeFoo: function(event) {
event.preventDefault();
console.log(new Date().valueOf());
}
})
I get the following 3 outputs in the console:
1333634360209
1333634360215
1333634360217
Does anybody know what’s causing this or what’s the best approach to debug the problem?
The actual problem was, that the Ember app was part of a Rails application which had two other Ember apps already. Those Ember apps didn’t have a
rootElementspecified. Adding arootElementfor every Ember app fixed the problem.