It looks like x is an array, not an object. So... I think you need to:
.map(x => {
    return x.filter(y => y.type === 'member');
})


On Wed, Jul 27, 2016 at 4:26 PM, T <[email protected]> wrote:

> up vote0down votefavorite
> <http://stackoverflow.com/questions/38622325/rxjs-filter-operator-not-working-with-angular2-observable#>
>
> In this plunker <http://plnkr.co/edit/9V8ASsmsbbbhsuD3MtaD?p=preview> I
> am trying to employ a filter operator on angular2 observable (Rxjs) inside
> class member.service.ts. The observable is fetched with an http request,
> which I process as follows:
>
>   getMembers (): Observable<Member[]> {
>     var one = this.http.get(this.memberUrl)
>     .map( this.extractData )
>     //.filter(x => x.type==='member')
>    return one
>  }
>
> My question is: Why would the list not render when I uncomment the line
> with the filter (please view the in-memory-data.service.ts) ? In my opinion
> the observable is in an object state after the map operator, and does not
> have a type property. not sure though!. thanks.
>
> --
> You received this message because you are subscribed to the Google Groups
> "AngularJS" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at https://groups.google.com/group/angular.
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Lucas Lacroix
Computer Scientist
System Technology Division, MEDITECH <http://ehr.meditech.com>
781-774-2293

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to