
Security News
New CVE Forecasting Tool Predicts 47,000 Disclosures in 2025
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
backbone.deep-model
Advanced tools
Forked from https://github.com/kawhee/backbone-deep-model (Thanks for the wonderful work @powmedia!)
Same as base repo, except that the package is scopeless.
The test cases are rewritten. This is primarily a browserify package. I'll work on making this work in other platforms if there is interest.
Improved support for models with nested attributes.
Allows you to get and set nested attributes with path syntax, e.g. user.type
.
Triggers change events for changes on nested attributes.
dist/backbone-deep-model.min.js
Then just have your models extend from Backbone.DeepModel instead of Backbone.Model.
Example code:
//Create models with nested attributes
var model = new Backbone.DeepModel({
id: 123,
user: {
type: 'Spy',
name: {
first: 'Sterling',
last: 'Archer'
}
},
otherSpies: [
{ name: 'Lana' },
{ name: 'Cyrril' }
]
});
//You can bind to change events on nested attributes
model.on('change:user.name.first', function(model, val) {
console.log(val);
});
//Wildcards are supported
model.on('change:user.*', function() {});
//Use set with a path name for nested attributes
//NOTE you must you quotation marks around the key name when using a path
model.set({
'user.name.first': 'Lana',
'user.name.last': 'Kang'
});
//Use get() with path names so you can create getters later
console.log(model.get('user.type')); // 'Spy'
//You can use index notation to fetch from arrays
console.log(model.get('otherSpies.0.name')) //'Lana'
Charles Davison - powmedia
master:
0.11.0:
0.10.4:
0.10.0:
0.9.0:
0.8.0:
0.7.4:
0.7.3:
0.7.2:
0.7.1:
0.7:
v2.0.2 -- 2015-03-23
FAQs
Improved support for models with nested attributes.
The npm package backbone.deep-model receives a total of 76 weekly downloads. As such, backbone.deep-model popularity was classified as not popular.
We found that backbone.deep-model demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CVEForecast.org uses machine learning to project a record-breaking surge in vulnerability disclosures in 2025.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.