ng2-wp-api
Advanced tools
Changelog
2.1.2
WpHttp
: used to return Observable.empty()
instead of Observable.throw(err)
.WpService.Model()
responses.CollectionResponse
and ModelResponse
with res.error
WpService.Model(): model response is now wrapped in ModelResponse object.
Before:
WpService.Model.(...).subscribe((res) => {
this.data = res.data;
}
After:
WpService.Model.(...).subscribe((res: ModelResponse) => {
if(res.error){
console.log(res.error);
}
else{
this.data = res.data;
}
});
Changelog
2.1.0
Use WpService.config
instead of WpConfig
to keep all usages in one service.
###Bugs:
Basic Authentication: Fixes request and return observable instead of void
WpService.auth().basic(username,password).subscribe(...)
WpService.Collection(): Added next()
and prev()
functions
collectionService = wpService.collection().posts().get.subscribe(...)
Get collectioncollectionService.more().subscrube(...)
Combine current page with next page collectioncollectionService.next().subscrube(...)
Get next page collectioncollectionService.prev().subscrube(...)
Get prev page collectionWpCollectionComponent: Added next()
and prev()
functions
Discovery endpoint: Discover if a url has WP API install.
WpService.discover(url).subscribe(...)
Cookies Authentication:
WpService.auth().cookies().subscribe(...)
All helper classes has been prefixed with Wp
Post
is now WpPost
User
is now WpUser
QueryArgs
is now WpQueryArgs
WpHelper.endpoint
is now WpEndpoint
WpHelper
is deprecated.authentication
notifier is deprecated from WpConfig
.Changelog
1.2.9
import {Collection} from 'ng2-wp-api/ng2-wp-api';
import {Collection} from 'ng2-wp-api';
Changelog
1.2.7
X-WP-Total
and X-Wp-Totalpages