Google News
logo
Backbone - Quiz(MCQ)
In Backbonejs, how can you change templates of a view on the fly?
A)
@company_location= new window.ArtistLocationForm({template: JST["templates/new_company_location"]})
B)
@company_location= new window.ArtistLocationForm({templates: JST["template/new_company_location"]})
C)
render: function(){ var templateFn = this.option.template || this.template; this.$el.html(templateFn(this.model.attributes)); return this; }
D)
render: function(){ var templateFn = this.options.template || this.template; this.$el.html(templateFn(this.model.attributes)); return this; }

Correct Answer :   render: function(){ var templateFn = this.options.template || this.template; this.$el.html(templateFn(this.model.attributes)); return this; }

Advertisement