Backbone.js get and set nested object attribute
问题 I have a simple question about Backbone.js\' get and set functions. 1) With the code below, how can I \'get\' or \'set\' obj1.myAttribute1 directly? Another question: 2) In the Model, aside from the defaults object, where can/should I declare my model\'s other attributes, such that they can be accessed via Backbone\'s get and set methods? var MyModel = Backbone.Model.extend({ defaults: { obj1 : { \"myAttribute1\" : false, \"myAttribute2\" : true, } } }) var MyView = Backbone.View.extend({