Skip to content

Instantly share code, notes, and snippets.

@kazu69
Created June 27, 2012 10:57
Show Gist options
  • Save kazu69/3003319 to your computer and use it in GitHub Desktop.
Save kazu69/3003319 to your computer and use it in GitHub Desktop.
Backviewでもdefault値を設定する例
var baseView = Backbone.View.extend({
defaults: {
defaulsVal: 'this is defaults'
},
initialize: function () {
_.defaults(this, this.defaults);
},
render: function () {
console.log(this.defaulsVal);
}
});
var view = new baseView();
view.render();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment