Ilya Chernomordik Ilya Chernomordik - 10 months ago 81
TypeScript Question

How to debug Observable values in Angualr2 / Typescript?

I have followed the tutorial for angular 2 and have a search functionality that renders a list of heroes asynchronously.

<div *ngFor="let hero of heroes | async"
(click)="gotoDetail(hero)" class="search-result">

In the component I have observable heroes:

heroes: Observable<Hero[]>;

Now I have implemented similar functionality in my application by I don't see anything and I don't see any errors either. I opened the debugger in Chrome and tried to check the value of heroes, but it's just some Observable wrapper of course.

Is there any way to see the current/last or some value in the debugger or maybe there is some other technique to debug such issues?

Answer Source