Skip to content

Commit 148ce4d

Browse files
committed
Merge branch 'release/3.0.0-alpha7'
2 parents 5ad9ce5 + be1961c commit 148ce4d

26 files changed

+286
-958
lines changed

‎.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ node_modules
2929

3030
www/
3131
config.json
32+
dist/

‎CHANGELOG.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
<a name="3.0.0-alpha7"></a>
2+
### 3.0.0-alpha7 (2016-07-30)
3+
4+
Making sure it is usable via TypeScript as well (export d.ts files).
5+
16
<a name="3.0.0-alpha2"></a>
27
### 3.0.0-alpha2 (2016-07-24)
38

@@ -6,4 +11,4 @@ Adding peer dependencies
611
<a name="3.0.0-alpha1"></a>
712
### 3.0.0-alpha1 (2016-07-23)
813

9-
First version for ng2.
14+
First version for ng2.

‎README.md

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,36 @@
1-
wp-api-angularjs
1+
wp-api-angular
22
================
33

4-
Angular2 services to consume [WP-API v2](http://v2.wp-api.org/) (< 2.5kb gziped)
4+
[![Join the chat at https://gitter.im/shprink/wp-api-angular](https://badges.gitter.im/shprink/wp-api-angular.svg)](https://gitter.im/shprink/wp-api-angular?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
55

6-
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)
6+
Angular2 services to consume [WP-API v2](http://v2.wp-api.org/)
7+
8+
[Live Demo](https://plnkr.co/edit/hqE4bvbM6HXql5Insjx8?p=preview)
9+
10+
If you want to use AngularJS v1, here is the latest version: [v2.0.0-rc3](https://github.com/shprink/wp-api-angular/tree/v2.0.0-rc3)
711

812
## Installation
913

1014
```shell
11-
npm install wp-api-angularjs
15+
npm install wp-api-angular
1216
```
1317

18+
### TypeScript
19+
20+
Nothing special if you use TS
21+
22+
### UMD
23+
24+
UMD files are available `wp-api-angular.umd.js` and `wp-api-angular.umd.min.js`, the [Live Demo](https://plnkr.co/edit/hqE4bvbM6HXql5Insjx8?p=preview) uses them with systemJS
25+
1426
## Bootstrap
1527

1628

1729
```js
1830
import {
1931
WPAPI_PROVIDERS,
2032
defaultWpApi
21-
} from 'wp-api-angularjs';
33+
} from 'wp-api-angular';
2234

2335
import {App} from './app';
2436

@@ -66,7 +78,21 @@ class RequestOptionsArgs {
6678
}
6779
```
6880

69-
This is where you can add query string to your request or change the headers.
81+
This is where you can add query string to your request or change the headers (see below).
82+
83+
```
84+
import { Headers } from '@angular/http';
85+
86+
const headers = new Headers({
87+
'Content-Type': 'application/json;charset=UTF-8',
88+
'Access-Control-Allow-Origin': '*',
89+
'Access-Control-Max-Age': '1728000',
90+
'Access-Control-Allow-Headers': 'Content-Type, Content-Range, Content-Disposition, Content-Description'
91+
'Access-Control-Allow-Methods': 'DELETE, HEAD, GET, OPTIONS, POST, PUT'
92+
});
93+
94+
wpApiPosts.getList({ headers });
95+
```
7096

7197
### WpApiPosts
7298

‎demo/app.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
WpApiStatuses,
1111
WpApiTerms,
1212
WpApiCustom
13-
} from 'wp-api-angularjs';
13+
} from '../dist/wp-api-angular';
1414
let config = require('../config.json');
1515

1616
@Component({

‎demo/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import 'rxjs/add/operator/toPromise';
44
import {
55
WPAPI_PROVIDERS,
66
defaultWpApi
7-
} from 'wp-api-angularjs'
7+
} from '../dist/wp-api-angular'
88
let config = require('../config.json');
99

1010
import {App} from './app';

0 commit comments

Comments
 (0)