Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- export class OpenArtService {
- http: any;
- baseUrl: string;
- array: any;
- constructor(http: Http) {
- this.http = http;
- this.baseUrl = 'http://openart.se/2017_beta/wp-json/wp/v2/artwork?_embed';
- }
- getData() {
- this.http.get(this.baseUrl).map(res => res.json()).subscribe(response => {
- this.array = Object.keys(response).map((key) => { return response[key] });
- });
- return this.http.get(this.baseUrl).map(res => res.json());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement