Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. export class OpenArtService {
  2. http: any;
  3. baseUrl: string;
  4. array: any;
  5.  
  6. constructor(http: Http) {
  7. this.http = http;
  8. this.baseUrl = 'http://openart.se/2017_beta/wp-json/wp/v2/artwork?_embed';
  9. }
  10.  
  11. getData() {
  12. this.http.get(this.baseUrl).map(res => res.json()).subscribe(response => {
  13. this.array = Object.keys(response).map((key) => { return response[key] });
  14. });
  15. return this.http.get(this.baseUrl).map(res => res.json());
  16. }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement