ng2-wp-api
Advanced tools
Comparing version 1.0.7 to 1.0.8
export class QueryArgs { | ||
public author: string; | ||
@@ -12,5 +13,5 @@ public context: any; | ||
public _embed: boolean; | ||
constructor(){ | ||
} | ||
} |
{ | ||
"name": "ng2-wp-api", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "WordPress API Service for Angular2", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
@@ -22,3 +22,3 @@ import { Http, Response } from '@angular/http'; | ||
hasMore: () => boolean; | ||
fetch: () => Observable<Response>; | ||
private fetch; | ||
} |
@@ -67,3 +67,3 @@ import {Injectable} from '@angular/core'; | ||
public fetch = ():Observable<Response> => { | ||
private fetch = ():Observable<Response> => { | ||
let url = WpHelper.generateUrl(this.actionUrl, this.args); | ||
@@ -70,0 +70,0 @@ let h = WpHelper.getHeaders(this.config); |
@@ -13,3 +13,3 @@ import { Http, Response } from '@angular/http'; | ||
setEndpoint: (endpoint: string | WpHelper.Endpoint) => void; | ||
get: (id: number) => Observable<Response>; | ||
get: (id: any, args?: any) => Observable<Response>; | ||
add: (body: any) => Observable<Response>; | ||
@@ -16,0 +16,0 @@ update: (id: number, body: any) => Observable<Response>; |
@@ -26,5 +26,6 @@ "use strict"; | ||
}; | ||
this.get = (id) => { | ||
this.get = (id, args) => { | ||
let url = helper_service_1.WpHelper.generateUrl(this.actionUrl + id, args); | ||
let h = helper_service_1.WpHelper.getHeaders(this.config); | ||
return this.http.get(this.actionUrl + id, { headers: h }).map(res => res.json()); | ||
return this.http.get(url, { headers: h }).map(res => res.json()); | ||
}; | ||
@@ -31,0 +32,0 @@ this.add = (body) => { |
@@ -26,5 +26,6 @@ import {Injectable} from '@angular/core'; | ||
public get = (id:number):Observable<Response> => { | ||
public get = (id, args?):Observable<Response> => { | ||
let url = WpHelper.generateUrl(this.actionUrl + id, args); | ||
let h = WpHelper.getHeaders(this.config); | ||
return this.http.get(this.actionUrl + id, {headers: h}).map(res => res.json()); | ||
return this.http.get(url, {headers: h}).map(res => res.json()); | ||
} | ||
@@ -31,0 +32,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38398
807