1
whereas I have a Json coming from a Url ('https://api.site.com.br/v1/servicos'). I created a service to pick up this object:
import { Injectable } from '@angular/core';
import { Http, Response, Headers } from '@angular/http';
@Injectable()
export class PlanosService {
//get Json Servicos
planos: Object[] = [];
constructor(http: Http) {
http
.get('https://api.carguruclub.com/v1/servicos')
.map(res => res.json())
.subscribe(planos => {
this.planos = planos;
console.log(this.planos);
}, erro => console.log(erro));
}
}
So far so good. However, my question is how to list the elements of this object.. For example, I wanted to take {{products.name}} and display that chunk of json and in my Component. I do not understand very well the paths I must follow, because I am a beginner. Thank you in advance.