javascript - How do i have a default property in ItemView or Layout in Backbone.marionette.js -


how have default property in itemview or layout in backbont.marionette.js.

we have default property in model following .

backbone.model.extend({        defaults: {             contract:"",          }     }); 

in above model have defaults have default properties. can have similar in itemview or layout

one should able change value defaults specified in itemview or layout

you can create defaults specifying them in view classes make. example;

var myview = backbone.marionette.composite.extend({     defaults:{         something: "value"     } }); 

now instances of myview have these defaults

var view = new myview({     initialize: function(){         var x = this.defaults.something; //x = "value"     } ); 

Popular posts from this blog

node.js - How do I prevent MongoDB replica set from querying the primary? -

Apache NiFi ExecuteScript: Groovy script to replace Json values via a mapping file -