You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Angular-data is approaching 1.0.0 Beta. The API is stabilizing and angular-data is well tested.
15
-
16
-
Although angular-data is being used in production, it's not 1.0.0. If you want to use Angular-data, keep an eye on the changelog. 1.0.0 will introduce strict semver (until then, minor number is bumped for breaking changes).
14
+
Angular-data is in a 1.0.0 Beta. The API is rather stable and angular-data is well tested.
17
15
16
+
Although angular-data is being used in production, it's not fully 1.0.0. If you want to use Angular-data, keep an eye on the changelog. 1.0.0 will introduce strict semver (until then, minor number is bumped for breaking changes).
Copy file name to clipboardExpand all lines: guide/angular-data/how.md
+75-4
Original file line number
Diff line number
Diff line change
@@ -3,8 +3,8 @@
3
3
@name How do I?
4
4
@description
5
5
6
-
####How do I serialize data before it's saved?
7
-
Before the data store sends date to an adapter, you may need to transform it to a custom request object of yours.
6
+
## How do I serialize data before it's saved?
7
+
Before the data store sends data to an adapter, you may need to transform it into a custom request object of yours.
8
8
9
9
Define a global serialization method:
10
10
```js
@@ -28,8 +28,8 @@ DS.defineResource({
28
28
});
29
29
```
30
30
31
-
####How do I deserialize data?
32
-
When an adapter returns data to the data store from the server, for example, you may need to extract data from a custom response object of yours.
31
+
## How do I deserialize data?
32
+
When an adapter returns data to the data store from a persistence layer, you may need to extract data from a custom response object of yours.
33
33
34
34
Define a global deserialization method:
35
35
```js
@@ -48,3 +48,74 @@ DS.defineResource({
48
48
}
49
49
});
50
50
```
51
+
52
+
## How do I use angular-cache with angular-data?
53
+
54
+
First, make sure you have angular-data.js and angular-cache.js loaded and your app has `angular-data.DS` and `angular-data.DSCacheFactory` as dependencies.
55
+
56
+
Each resource you define will have its own cache instance, so you can pass different options to each resource.
57
+
58
+
```js
59
+
varDocument=DS.defineResource({
60
+
name:'document',
61
+
maxAge:900000,
62
+
deleteOnExpire:'aggressive'
63
+
});
64
+
65
+
var User =DS.defineResource({
66
+
name:'user',
67
+
maxAge:36000000,
68
+
deleteOnExpire:'aggressive',
69
+
onExpire:function (id, user) {...}
70
+
});
71
+
```
72
+
73
+
## How do I add my own static methods to resources?
0 commit comments