Skip to content

Commit 1ce4c3b

Browse files
committed
Fixes #76.
1 parent 96b90e2 commit 1ce4c3b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+6737
-6639
lines changed

.jshintrc

+37-32
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,39 @@
11
{
2-
"node": false,
3-
"browser": true,
4-
"es5": true,
5-
"esnext": true,
6-
"bitwise": true,
7-
"camelcase": true,
8-
"curly": true,
9-
"eqeqeq": true,
10-
"immed": true,
11-
"indent": 2,
12-
"latedef": true,
13-
"newcap": true,
14-
"noarg": true,
15-
"quotmark": "single",
16-
"regexp": true,
17-
"undef": true,
18-
"unused": true,
19-
"strict": true,
20-
"trailing": true,
21-
"smarttabs": true,
22-
"predef": [
23-
"inject",
24-
"describe",
25-
"it",
26-
"beforeEach",
27-
"afterEach",
28-
"assert",
29-
"require",
30-
"module",
31-
"exports",
32-
"angular"
33-
]
2+
"node": false,
3+
"browser": true,
4+
"es5": true,
5+
"esnext": true,
6+
"bitwise": true,
7+
"camelcase": true,
8+
"curly": true,
9+
"eqeqeq": true,
10+
"immed": true,
11+
"indent": 2,
12+
"latedef": true,
13+
"newcap": true,
14+
"noarg": true,
15+
"quotmark": "single",
16+
"regexp": true,
17+
"undef": true,
18+
"unused": true,
19+
"strict": false,
20+
"trailing": true,
21+
"smarttabs": true,
22+
"globals": {
23+
"inject": true,
24+
"describe": true,
25+
"it": true,
26+
"beforeEach": true,
27+
"afterEach": true,
28+
"assert": true,
29+
"startInjector": true,
30+
"DS": true,
31+
"fail": true,
32+
"$httpBackend": true,
33+
"console": true,
34+
"require": true,
35+
"module": true,
36+
"exports": true,
37+
"angular": true
38+
}
3439
}

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
##### 0.10.0 - 24 June 2014
2+
3+
###### Breaking API changes
4+
- #76 - Queries and filtering. See [TRANSITION.md](https://github.com/jmdobry/angular-data/blob/master/TRANSITION.md).
5+
16
##### 0.9.1 - 30 May 2014
27

38
###### Backwards compatible bug fixes

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
__Data store for Angular.js.__
44

5-
__Latest Release:__ [0.9.1](http://angular-data.codetrain.io/)
6-
__master:__ [0.9.1](http://angular-data-next.codetrain.io/)
5+
__Latest Release:__ [0.9.1](http://angular-data.pseudobry.com/)
6+
__master:__ [0.9.1](http://angular-data-next.pseudobry.com/)
77

88
Angular-data is in a pre-1.0.0 development stage; the API is fluctuating, not a lot of tests yet, etc.
99

TRANSITION.md

+94
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
### 0.9.x. ---> 0.10.0 - 24 June 2014
2+
3+
#### Breaking API changes
4+
##### #76 - Queries and filtering.
5+
6+
###### Before
7+
```javascript
8+
DS.findAll('post', {
9+
query: {
10+
where: {
11+
name: 'John'
12+
}
13+
}
14+
})
15+
```
16+
17+
###### After
18+
```javascript
19+
DS.findAll('post', {
20+
where: {
21+
name: 'John'
22+
}
23+
})
24+
```
25+
26+
###### Before
27+
```javascript
28+
DS.filter('post', {
29+
query: {
30+
where: {
31+
name: 'John'
32+
}
33+
}
34+
})
35+
```
36+
37+
###### After
38+
```javascript
39+
DS.filter('post', {
40+
where: {
41+
name: 'John'
42+
}
43+
})
44+
```
45+
46+
###### Before
47+
```javascript
48+
// override how DS.filter handles the "where" clause
49+
DSProvider.defaults.filter = function (resourceName, where, attrs) {
50+
// return true to keep the item in the result set
51+
// return false to exclude it
52+
};
53+
```
54+
55+
###### After
56+
```javascript
57+
// override how DS.filter handles the "where", "skip", "limit" and "orderBy" clauses
58+
DSProvider.defaults.filter = function (collection, resourceName, params, options) {
59+
// examine params and
60+
// decide whether to exclude items, skip items, start from an offset, or sort the items
61+
62+
// see the [default implementation that ships with angular-data](https://github.com/jmdobry/angular-data/blob/master/src/datastore/index.js#L12)
63+
// overriding this method is useful when our server only understands a certain
64+
// params format and you want angular-data's filter to behave the same as your server
65+
66+
// angular-data looks for the following fields:
67+
// - where
68+
// - skip (or offset)
69+
// - limit
70+
// - orderBy (or sort)
71+
72+
// return the filtered collection
73+
};
74+
```
75+
76+
###### Before
77+
```javascript
78+
DSHttpAdapter.defaults.queryTransform = function (resourceName, query) {
79+
// the second argument was the "query" field of the "params" passed in the DSHttpAdapter method
80+
// return the transformed query
81+
};
82+
```
83+
84+
###### After
85+
```javascript
86+
// This is useful when you don't want to implement the filter method above
87+
// and instead rely on angular-data's expectation of where, skip, limit, orderBy, etc.
88+
// This transform is useful when you want to change the where, skip, limit, orderBy, etc. fields
89+
// into something your server understands.
90+
DSHttpAdapter.defaults.queryTransform = function (resourceName, params) {
91+
// the second argument is now the whole "params" object passed in the DSHttpAdapter method
92+
// return the transformed params
93+
};
94+
```

bower.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
"author": "Jason Dobry",
33
"name": "angular-data",
44
"description": "Data store for Angular.js.",
5-
"version": "0.9.1",
6-
"homepage": "http://angular-data.codetrain.io/",
5+
"version": "0.10.0",
6+
"homepage": "http://angular-data.pseudobry.com/",
77
"repository": {
88
"type": "git",
99
"url": "git://github.com/jmdobry/angular-data.git"

0 commit comments

Comments
 (0)