mardi 29 septembre 2015

How do you render a template dynamically when not leaving a route?

I'm working on a tabbed modal, whose endpoint looks like 'account/tab_id'. When navigating from, say 'account/1' to 'account/2' the url updates as it should and all of the hooks kick off as intended with the exception of the renderTemplate hook. Do you have any thoughts on how I can rework this to get that hook firing? My relevant route code looks like:

model:function(params){
    var tabId = params.tab_id, 
    parentModel = this.modelFor('dashboard.home.account');
    this.set('tabId',parseInt(tabId));
    return parentModel;
},
afterModel:function(model){
    this.set('modelName',model.get('_internalModel.modelName'));
    this.set('templateName',this.get('modelName') + '/' + this.get('tabId'));
},
renderTemplate: function(controller,model) {
    //not getting called after first render
    this.render('edit.'+ this.get('templateName'),{ 
        into:'dashboard',
        outlet: 'modal' 
    });
},




Aucun commentaire:

Enregistrer un commentaire