Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/amccloud/backbone-dotattr
Access deep Backbone.js model attributes with dot-syntax.
https://github.com/amccloud/backbone-dotattr
Last synced: 3 months ago
JSON representation
Access deep Backbone.js model attributes with dot-syntax.
- Host: GitHub
- URL: https://github.com/amccloud/backbone-dotattr
- Owner: amccloud
- License: mit
- Created: 2012-05-10T10:09:53.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2015-12-08T20:43:10.000Z (almost 9 years ago)
- Last Synced: 2024-05-23T05:33:21.823Z (6 months ago)
- Language: JavaScript
- Homepage: https://github.com/amccloud/backbone-dotattr
- Size: 97.7 KB
- Stars: 49
- Watchers: 4
- Forks: 10
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Backbone Dotattr [![Build Status](https://secure.travis-ci.org/amccloud/backbone-dotattr.png)](http://travis-ci.org/amccloud/backbone-dotattr]) #
Access deep Backbone.js model attributes with dot-syntax.## Example ##
```javascript
var song = new Backbone.Model({
title: "Lucy In The Sky With Diamonds",
album: new Backbone.Model({
title: "Sgt. Pepper's Lonely Hearts Club Band",
release: {
year: "1987"
}
})
});// Deep model attributes
song.get('album.title'); // "Sgt. Pepper's Lonely Hearts Club Band"// Deep object attributes
song.has('album.release.year'); // true
song.get('album.release.year'); // "1987"// Regular attributes
song.get('title') // "Lucy In The Sky With Diamonds"
```## Supported Methods ##
- get
- escape
- has