I\'m trying to display some info in the dom but I get this error:
Error: Error trying to diff \'[object Object]\'
What Im trying to
If you want to have price
as an array, then you have push
the object in prices
array.
ngOnInit(){
this.surbtcService.getPricess()
.subscribe(
data => this.prices.push(data.ticker);
);
}
OR, you can just directly access the object properties by assigning data.ticker
to prices
.
private prices = new SurbtcMarketView();
constructor(private surbtcService: SurbtcService) {
}
ngOnInit(){
this.surbtcService.getPricess()
.subscribe(data =>{
this.prices = data.ticker;
});
}
HTML:
{{item}}
UPDATE:
See the Plnkr demo, I have resolved the issue that was causing error in parsing the json response.