Considering that I have a Json coming from a Url (' link '). I created a service to get 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 on how to list the elements of this object .. For example, I wanted to get {{products.name}} and display that json snippet and in my component. I do not understand very well the paths that I must follow, since I am a beginner. Thank you in advance.