Skip to main content

Posts

Showing posts with the label angular observables

Angular 4 Observables

Angular 4 Observables The result of the Http.get method is an object, which is an example of an observable. Observables are part of a library called Reactive Extensions, produced by Microsoft, which is used by Angular to connect different parts of the appplication. [Essential Angular for ASP.NET Core MVC by Adam Freeman] Below are Angular 4 Observables questions and answers for your practice. 1. You import Observable from rxjs/observable to be used within a component. Once you have it imported, you can create an observable object by using the following syntax, where 'vname' is an observable name: 2. Observables allow you to watch values for changes over time and also Observables can have multiple values over time. A) True B) False 3. We can subscribe to an observable using the . . . . . . . . The benefit of this is that Angular deals with your subscription during the lifecycle of a component. Angular will automatically subscribe and unsubscribe for you. A) sync pi...