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

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo