Skip to content

Commit b0c162b

Browse files
committed
adding live demo
1 parent fc8ea97 commit b0c162b

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

README.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ wp-api-angularjs
55

66
Angular2 services to consume [WP-API v2](http://v2.wp-api.org/) (< 2.5kb gziped)
77

8+
[Live Demo](https://plnkr.co/edit/hqE4bvbM6HXql5Insjx8?p=preview)
9+
810
If you want to use AngularJS v1, here is the latest version: [v2.0.0-rc3](https://github.com/shprink/wp-api-angularjs/tree/v2.0.0-rc3)
911

1012
## Installation
@@ -68,7 +70,21 @@ class RequestOptionsArgs {
6870
}
6971
```
7072

71-
This is where you can add query string to your request or change the headers.
73+
This is where you can add query string to your request or change the headers (see below).
74+
75+
```
76+
import { Headers } from '@angular/http';
77+
78+
const headers = new Headers({
79+
'Content-Type': 'application/json;charset=UTF-8',
80+
'Access-Control-Allow-Origin': '*',
81+
'Access-Control-Max-Age': '1728000',
82+
'Access-Control-Allow-Headers': 'Content-Type, Content-Range, Content-Disposition, Content-Description'
83+
'Access-Control-Allow-Methods': 'DELETE, HEAD, GET, OPTIONS, POST, PUT'
84+
});
85+
86+
wpApiPosts.getList({ headers });
87+
```
7288

7389
### WpApiPosts
7490

0 commit comments

Comments
 (0)