Property ‘filter’ does not exist on type ‘Observable’

UPDATE

For RXJS 5.x version:

import 'rxjs/add/operator/filter';

For RXJS 6.x version:

import { filter } from 'rxjs/operators';

The following rules have been designed by the RxJS team to help
JavaScript developers refactor import paths:

  1. rxjs/operators: Contains all pipeable operators.

import { map, filter, scan } from 'rxjs/operators';

  1. rxjs: Contains creation methods, types, schedulers, and utilities.

import { Observable, Subject, asapScheduler, pipe, of, from,
interval, merge, fromEvent } from 'rxjs';

Leave a Comment

tech