File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ A lightweight Angular 2 adapter for [JSON API](http://jsonapi.org/)
21
21
- [ Creating Records] ( #creating-records )
22
22
- [ Updating Records] ( #updating-records )
23
23
- [ Persisting Records] ( #persisting-records )
24
+ - [ Deleting Records] ( #deleting-records )
24
25
- [ Relationships] ( #relationships )
25
26
- [ Custom Headers] ( #custom-headers )
26
27
- [ TODO] ( #todo )
@@ -292,6 +293,15 @@ this.datastore.findRecord(Post, '1').subscribe(
292
293
);
293
294
```
294
295
296
+ #### Deleting Records
297
+
298
+ For deleting a record, just call the datastore's method ` deleteRecord() ` , passing the type and the id of the record:
299
+
300
+ ``` typescript
301
+ this .datastore .deleteRecord (Post , ' 1' ).subscribe (() => {
302
+ // deleted!
303
+ });
304
+ ```
295
305
296
306
### Relationships
297
307
@@ -394,7 +404,7 @@ post.save({}, new Headers({'Authorization': 'Bearer ' + accessToken})).subscribe
394
404
395
405
396
406
## TODO
397
- - [ ] Deleting records
407
+ - [x ] Deleting records
398
408
- [ ] Conversion to and from ` Date ` property
399
409
- [ ] Handling validation errors
400
410
- [ ] Updating or removing a relationship
You can’t perform that action at this time.
0 commit comments