Skip to content

Commit

Permalink
Stable Version 0.9.0.
Browse files Browse the repository at this point in the history
Documentation improvements.
  • Loading branch information
jmdobry committed May 23, 2014
1 parent 2321073 commit 3b0e4bc
Show file tree
Hide file tree
Showing 5 changed files with 98 additions and 58 deletions.
38 changes: 37 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,45 @@
##### 0.9.0 - xx May 2014

###### Breading API changes
###### Breaking API changes
- #61 - Make custom serializers/deserializers more valuable
- #59, #62 - Make queryTransform() consistent with the rest of the API

__Before:__

```js
DSHttpAdapterProvider.defaults.serialize = function (data) { ... };
```

__After:__

```js
DSProvider.defaults.serialize = function (resourceName, data) { ... };
```

__Before:__

```js
DSHttpAdapterProvider.defaults.deserialize = function (data) { ... };
```

__After:__

```js
DSProvider.defaults.deserialize = function (resourceName, data) { ... };
```

__Before:__

```js
DSHttpAdapterProvider.defaults.queryTransform = function (query) { ... };
```

__After:__

```js
DSHttpAdapterProvider.defaults.queryTransform = function (resourceName, query) { ... };
```

###### Backwards compatible API changes
- #30, #48, #66 - DSCacheFactory integration
- #49 - DS.bindOne($scope, prop, resourceName, id)
Expand Down
13 changes: 3 additions & 10 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,7 @@ module.exports = function (grunt) {
'guide/angular-data/asynchronous.doc',
'guide/angular-data/synchronous.doc',
'guide/angular-data/queries.doc',
'guide/angular-data/adapters.doc',
'guide/angular-data/how.doc'
],
rank: {
Expand All @@ -248,7 +249,8 @@ module.exports = function (grunt) {
asynchronous: 4,
synchronous: 5,
queries: 6,
how: 7
adapters: 7,
how: 8
}
},
{
Expand Down Expand Up @@ -286,15 +288,6 @@ module.exports = function (grunt) {
lifecycle: 5,
custom: 6
}
},
{
id: 'angular-data-adapters',
title: 'Adapters',
docs: ['guide/angular-data/adapters/'],
rank: {
index: 1,
overview: 2
}
}
]
},
Expand Down
55 changes: 55 additions & 0 deletions guide/angular-data/adapters.doc
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
@doc overview
@id adapters
@name Adapters
@description

Angular-data ships with a `DSHttpAdapter` and a `DSLocalStorageAdapter`. This is default adapter
used for `DS.findAll`, `DS.update`, etc.

Register a custom adapter:
```js
DS.adapters.myCustomAdapter = { ... };
```

Other available adapters:

- [DSLocalForageAdapter](https://github.com/jmdobry/angular-data-localForage)

The default adapter can be set globally:

```js
DSProvider.defaults.defaultAdapter = 'DSHttpAdapter';
```

per resource:

```js
DS.defineResource({
name: 'user',
defaultAdapter: 'DSLocalForageAdapter'
});
```

per method

```js
DS.update('post', 45, { author: 'Sally' }, { adapter: 'DSLocalForageAdapter' });
```

### Write Your Own Adapter

For the data store to be able to use an adapter of yours, your adapter needs to implement the adapter API. Here it is:

- `find`
- `findAll`
- `create`
- `update`
- `updateAll`
- `destroy`
- `destroyAll`

Rather than repeat documentation here, you can find the method signatures and descriptions in the [DSHttpAdapter API](/documentation/api/angular-data/DSHttpAdapter.methods:find).

The difference between the DSHttpAdapter and your adapter is that yours might not use HTTP, rather, it might interact with localStorage or indexedDb instead.

You can post any questions on the [mailing list](https://groups.google.com/forum/?fromgroups#!forum/angular-data).
47 changes: 0 additions & 47 deletions guide/angular-data/adapters/adapters.doc

This file was deleted.

3 changes: 3 additions & 0 deletions guide/nav.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@
<li>
<a href="/documentation/guide/angular-data/queries">Queries & Filtering</a>
</li>
<li>
<a href="/documentation/guide/angular-data/adapters">Adapters</a>
</li>
<li>
<a href="/documentation/guide/angular-data/how">How do I...?</a>
</li>
Expand Down

0 comments on commit 3b0e4bc

Please sign in to comment.