Skip to content

Commit f44b58b

Browse files
committed
Merge branch 'release/1.0.0-rc2'
2 parents fb4de11 + ee2f70b commit f44b58b

15 files changed

+1908
-89
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@ wp-api-angularjs
33

44
wp-api-angularjs is under development and will only cover GET methods of the [WP-API](https://github.com/WP-API/WP-API) master branch.
55

6+
## Install
7+
8+
include the bundled version ```wp-api-angularjs.bundle.js``` (Contains underscore and Restangular) and add the library to your dependencies:
9+
10+
```
11+
angular.module('myApp', ['wp-api-angularjs']);
12+
```
13+
614
## Services
715

816
### WpApiProvider
@@ -16,10 +24,27 @@ wp-api-angularjs is based on Restangular therefore you can use any of the [Resta
1624
});
1725
```
1826

27+
wp-api-angularjs always returns promises:
28+
29+
```
30+
$wpApiPosts.$get(id).then(function(post) {
31+
// OK
32+
}).catch(function() {
33+
// KO
34+
});
35+
```
36+
1937
### Posts ```$wpApiPosts```
2038

2139
```
40+
// Get latests posts
2241
$wpApiPosts.$getList();
42+
43+
// Get latests uncategorized posts
44+
$wpApiPosts.$getList({
45+
'category_name': 'uncategorized'
46+
});
47+
2348
$wpApiPosts.$get(id);
2449
2550
# DOES NOT WORK FOR NOW

0 commit comments

Comments
 (0)