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

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -