angular2-data
This is project is a data layer for angular2. It's still early times, but comes with an example project based on the Heroes tutorial from the angular2 documentation.
Installation
npm install angular2-data
Usage
You'll need to create a Store which you can inject into a component or service. Use the StoreConfig to set the baseURL.
;;
The constructor is required so that the store is injected with an Http service.
To use a store, you'll need a model:
;; ;
You can then retrieve and create models.
this.store.queryThing.subscribe; this.store.findThing, 1.subscribe; this.store.createnew Thing.subscribe;
TODONE
- Tests (thank to angular2-testing, jasmine, and rollup!)
- update
TODO
- Delete
- Relationships
- jsonapi support
- Identity cache
- server sent updates