Top "Observable" questions

An observable is typically a programming construct that can be "watched" by other parts of the code, called the "observers". Different frameworks and programming languages have different implementations for observables, so this tag should typically be used in conjunction with others.

How to catch exception correctly from http.request()?

Part of my code: import {Injectable} from 'angular2/core'; import {Http, Headers, Request, Response} from 'angular2/http'; import {Observable} from …

http typescript angular observable
Creating and returning Observable from Angular 2 Service

This is more of a "best practices" question. There are three players: a Component, a Service and a Model. The …

angular observable
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 …

angular rxjs observable subscription angular-component-life-cycle
Return an empty Observable

The function more() is supposed to return an Observable from a get request export class Collection{ public more = (): Observable<…

javascript typescript rxjs observable
When should we use Observer and Observable?

An interviewer asked me: What is Observer and Observable and when should we use them? I wasn't aware of these …

java design-patterns observable observer-pattern observers
Using an array from Observable Object with ngFor and Async Pipe Angular 2

I am trying to understand how to use Observables in Angular 2. I have this service: import {Injectable, EventEmitter, ViewChild} from …

typescript angular rxjs observable
How to get data from observable in angular2

I am trying to print the result of http call in Angular using rxjs Consider the following code import { Component, …

typescript angular reactive-programming rxjs observable
Delegation: EventEmitter or Observable in Angular

I am trying to implement something like a delegation pattern in Angular. When the user clicks on a nav-item, I …

angular observer-pattern observable eventemitter event-delegation
How to create an Observable from static data similar to http one in Angular?

I am having a service that has this method: export class TestModelService { public testModel: TestModel; constructor( @Inject(Http) public http: …

typescript promise angular observable rxjs