javascript - Backbone model attribute -
i have backbone model looks this:
var user = backbone.model.extend({ idattribute: "_id", givenname: 'usermodel', urlroot: '/users', defaults: { firstname: null, lastname: null, username: null, password: null, email: null }, initialize: function (options) { this.options = options || {}; _.bindall(this, 'deletemodel', 'persist', 'validate'); }, constructor: function (attributes, options) { backbone.model.apply(this, arguments); }, validate: function (attr) { return undefined; }, persist: function (adds, callback) { }, deletemodel: function (callback) { } });
but why doesn't givenname show in debugger? assume it's nature of backbone , nothing that's wrong code or debugger.
here console.logged "model.givenname" , indeed defined. don't understand how backbone working:
https://www.dropbox.com/s/h61xpl8st98wcqi/screenshot%202015-07-07%2020.57.49.png?dl=0
Comments
Post a Comment