All Questions

166
votes
18answers
47641 views

What is the correct way to share the result of an Angular Http network call in RxJs 5?

By using Http, we call a method that does a network call and returns an http observable: getCustomer() { return this.http.get('/someUrl').map(res => res.json()); } If we take this observab...
225
votes
8answers
132639 views

Angular HTTP GET with TypeScript error http.get(...).map is not a function in [null]

I have a problem with HTTP in Angular. I just want to GET a JSON list and show it in the view. Service class import {Injectable} from "angular2/core"; import {Hall} from "./hall"; import {Http} f...
286
votes
11answers
61362 views

Angular/RxJs When should I unsubscribe from `Subscription`

When should I store the Subscription instances and invoke unsubscribe() during the NgOnDestroy life cycle and when can I simply ignore them? Saving all subscriptions introduces a lot of mess into com...
39
votes
4answers
10621 views

Hot and Cold observables : are there 'hot' and 'cold' operators?

I reviewed the following SO question: What are the Hot and Cold observables? To summarize: a cold observable emits its values when it has an observer to consume them, i.e. the sequence of values re...
494
votes
12answers
128017 views

Angular - Promise vs Observable

Can some one please explain me Promise vs Observable in Angular? Any sample of each would be help in understanding both cases. And when to use each case with scenario.
218
votes
4answers
104827 views

BehaviorSubject vs Observable?

I'm looking into Angular RxJs patterns and I don't understand the difference between a BehaviorSubject and an Observable. From my understanding, a BehaviorSubject is a value that can change over time...
33
votes
3answers
61688 views

Observable type error: cannot read property of undefined

Angular 2 application, I get an error: cannot read property 'title' of undefined. This is a very simple component, just trying to get a bare minimum to work here. It hit's my API controller (curious...
16
votes
2answers
18843 views

Angular 2 - Return data directly from an Observable

I've been banging my head against this one trying to figure it out, and no amount of documentation I've been able to read has given me an answer to my question. I have a service which is speaking dir...
13
votes
1answers
8035 views

What are the semantics of different RxJS subjects?

Documentation for the topic is sparse and it's hard to discover an "entry-point" there.
71
votes
5answers
34417 views

What is "callback hell" and how and why RX solves it?

Can someone give a clear definition together with a simple example that explains what is a "callback hell" for someone who does not know JavaScript and node.js ? When (in what kind of settings) does ...

Previous Next