backbone.deepmodel
v1.2.4
Published
Backbone.DeepModel plugin
Downloads
22
Readme
Backbone.DeepModel plugin
Super simple and lightweight Backbone.js plugin
to handle nested attributes of Backbone.Model
.
Please see demo.
Table of Contents
Install
via npm
:
npm install backbone backbone.deepmodel
via yarn
:
yarn add backbone backbone.deepmodel
or download manually:
Dependencies
- Backbone.js 1.2+
Use
import DeepModel from 'backbone.deepmodel'
class Person extends DeepModel {
defaults() {
return {
name: {first: '', last: ''},
pets: []
}
}
}
const p = new Person()
p.set('name.first', 'Tom')
In browser:
<script src="//unpkg.com/underscore/underscore-min.js"></script>
<script src="//unpkg.com/backbone/backbone-min.js"></script>
<script src="//unpkg.com/backbone.deepmodel/dist/backbone.deepmodel.min.js"></script>
For details, see API Documentation.
Changelog
See here.
Contribute
See here.
License
MIT © ybiquitous