I have my servers.service.ts that does a GET REQUEST this:
getServers(){
return this.http.get('https://*******.firebaseio.com/data.json').map((response: Response)=>{const data=response.json();console.log(data);return data;});
}
And in my app.component.ts I do this:
onGet(){
this.serverService.getServers().subscribe(
(servers: any[])=> this.servers=servers,
(error)=>console.log(error)
);
}
I use like db firebase and it throws this exception
Error trying to diff '[object Object]'. Only arrays and iterables are allowed
when I call onGet(). Anyone can help me?