Give your data the treatment it deserves with a data store built for Angular.js.
Show me!
Why angular-data?
Inspired by Ember Data, angular-data is
the model layer Angular is missing. It consists of a convenient in-memory cache for managing your data,
and several adapters for communicating with
various persistence layers.
By default angular-data uses the http adapter which is perfect for communicating with your RESTful backend. It comes with a localStorage adapter, and another localforage adapter is also available. More adapters are coming, and you're free to implement your own.
Unlike Backbone and Ember Models, angular-data does not require the use of getters and setters, and
doesn't wrap your data with custom classes if you don't want it to. Angular-data's internal
dirty-checking (via observe-js or
Object.observe
in supporting browsers) allows for powerful use cases and an easy avenue for
implementing your own 3-way
data-binding.
Supporting relations, computed properties, model lifecycle control and a slew of other features, angular-data is the tool for giving your data the respect it deserves.
angular-data.js vs angular-cache.js?
angular-data.js is the full data store that supports collections and communicating with persistence
layers. angular-cache.js is a simple key-value store and an api-compatible replacement for
$cacheFactory
with advanced caching capabilities. Use one, or the other, or use both and
angular-data will be able to take advantage of some of the features of angular-cache.
How do I get it?
npm install --save angular-data
or bower install --save angular-data
then add
angular-data.DS
as a dependency of your angular app.
npm install --save angular-cache
or bower install --save angular-cache
then add
angular-data.DSCacheFactory
as a dependency of your angular app.
Angular-data does not require angular-cache in order to work.
Now what?
Project | angular-data | angular-data-mocks | angular-cache |
---|---|---|---|
Branch | master | master | master |
Bower |
![]() |
![]() |
![]() |
NPM |
![]() |
![]() |
![]() |
Build Status |
![]() |
![]() |
![]() |
Code Climate |
![]() |
![]() |
![]() |
Dependency Status |
![]() |
![]() |
![]() |
Coverage |
![]() |
![]() |
![]() |
License | MIT License | MIT License | MIT License |
Copyright (C) 2014 Jason Dobry
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.