backbone.js - How do I check which template is being used in Marionette ItemView -
i have multiple templates declared in marionette itemview , when render itemview template want use.
templates: { 'images': imageresulttmpl, 'music': mediaresulttmpl, 'videos': mediaresulttmpl },
inside method in itemview can name of active template?
if(music){ this; } else{ that; }
my first thought should have different itemviews each template , render correct itemview depending on situation. if you're trying dry code, maybe create base itemview holds common code , have specialized itemviews extend base class.
Comments
Post a Comment