Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Support for Dot Notation in Backbone Models

Tags:

backbone.js

How to get support for dot notation/nested objects in backbone model. The plugins that are available are buggy and wondering if backbone would ever support

person = { name : {first: 'hon',last:'son'}}
model = new Backbone.Model(person)
model.get('name.first')
model.set('name.first','bon') 
like image 204
coool Avatar asked Jul 26 '26 11:07

coool


1 Answers

There are two plugins to get the job done:

  • Backbone Nested
  • Backbone Deep Model

Both handle getting and setting attributes and change events for dot notation.

like image 188
VuesomeDev Avatar answered Jul 28 '26 07:07

VuesomeDev



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!