The ability to reply to discussions is limited to PRO members. Want to join in the discussion? Click here to subscribe now.

Consuming events as Observables in Angular 2

Consuming events as Observables in Angular 2

3:07
In this video series we’ll take a look at Observables in Angular 2. We’ll figure out how they integrate with the http layer and how we can leverage their power to build a rock solid instant search with just a bunch of operators. This first video walks you through the process of refactoring an existing solution to consume events from the template as Observables.
Watch this lesson now
Avatar
egghead.io

In this video series we’ll take a look at Observables in Angular 2. We’ll figure out how they integrate with the http layer and how we can leverage their power to build a rock solid instant search with just a bunch of operators.

This first video walks you through the process of refactoring an existing solution to consume events from the template as Observables.

Avatar
Karstacian

If I call the subscribe in the search function will it not create a new subscription each time I call search?

Avatar
Creativestyle

It seems to me that there is a typing in : URLSerachParams (Search not Serach)

Avatar
Oscar

+1, would be nice to have a github repo to this post so it can be updated.
I am receiving no provider for connectionbackend! as an error with described code above

In reply to Creativestyle
Avatar
Corey

Hi, found the issue with the error you noted above, I was importing the HttpModule and needed to import the JsonpModule under the 'imports' property in @NgModule decorator.

In reply to Oscar
Avatar
sk29110

Is it possible to remove echo sound from the video. I didn't find it on other videos but this series have extra echoing.

In reply to egghead.io
Avatar
James

for brevity:

// app.module.ts
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule } from '@angular/forms';
import { HttpModule, JsonpModule } from '@angular/http';

import { AppComponent } from './app.component';
import { WikipediaSearchService } from './wikipedia-search.service';

@NgModule({
  declarations: [
    AppComponent,
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    JsonpModule
  ],
  providers: [
    WikipediaSearchService
  ],
  bootstrap: [AppComponent]
})
export class AppModule { }
In reply to Corey
Avatar
Kemal Yalcinkaya

URLSerachParams seems to be deprecated by the Angular team, FYI

Avatar
Angela

Hi, I'm new to Angular 2. I see JSONP is being used for HTTP GET call. Can JSONP be used for POST/PUT/DELETE calls? I got 403 error when doing PUT/DELETE calls with JSON. Any insights would be appreciated.

In reply to egghead.io
Avatar
Jacob

I'm learning ngrx and came across a similar problem for fetching data from the server and displaying. Here is the code for it: https://github.com/ngrx/example-app/blob/master/src/app/effects/book.ts

My question is why the ngrx example is done differently with just Observable and not Subject. I also posted a question in stack overflow at http://stackoverflow.com/questions/42596635/why-takeuntil-is-necessary-in-this-ngrx-example

HEY, QUICK QUESTION!
Joel's Head
Why are we asking?