N
N
nutritsio2017-08-09 18:48:49
Angular
nutritsio, 2017-08-09 18:48:49

How to write such logic through Observable?

How to write the same logic through Observable and not through Promise?
57f8263760ee472a9658346abfafb420.png
PS I tried it, it gives syntax errors =(
ca43d6e1720147ab804b8204655e9e7d.png

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
denismaster, 2017-08-09
@nutritsio

getUser(id: number) : Observable<User>{
    return Observable.of(HEROES).filter(hero=>hero.id === id);
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question