Hi everyone, I need to execute jquery code every time template is refreshed and for that I have created this:
CCM_ROOT.HomeTemplateView = Ember.View.extend({
templateName: 'HomeTemplate',
didInsertElement: function() {
alert();
}
});
and I am updating my hometemplate using polling and below is the coding for same:
CCM_ROOT.HomeTemplateRoute = Ember.Route.extend({
model: function(){
return this.store.find('agent');
},
recursive: function() {
this.model();
this.set('poll',Ember.run.later(this,function(){this.recursive();},5000));
},
setupController : function(controller, model)
{
this.controllerFor('homeTemplate').set('model',model);
this.controllerFor('homeTemplate').changeTheHeader();
this.recursive();
},
deactivate : function(){
Ember.run.cancel(this.get('poll'));
}
});
Issue: didInsertElement() is called when I reload the page. But I require it to fire every time when template is updated.