DeepModel
Extends:
backbone~Backbone.Model → DeepModel
Example:
class Person extends DeepModel {...}
// or
const Person = DeepModel.extend({...})
Static Member Summary
Static Public Members | ||
public static get |
this module's version. |
Static Method Summary
Static Public Methods | ||
public static |
Update default settings. |
Method Summary
Public Methods | ||
public |
|
|
public |
|
Static Public Methods
public static defaults(settings: Object): Object source
Update default settings.
Example:
DeepModel.defaults({anySetting: true})
DeepModel.defaults(null) // reset!
DeepModel.defaults({pathSeparator: '/'})
const model = new DeepModel()
model.set('a', {})
model.set('a/b', 1)
model.get('a/b') //=> 1
DeepModel.defaults({
pathParser(path) {
if (path === '*') { return [] } // ignore!
return path.split('_')
}
})
const model = new DeepModel()
model.set('a', {})
model.set('a_b', 1)
model.get('a_b') //=> 1
model.set('*', 2)
model.get('*') //=> undefined