Reputation: 8519
Hi I have a subscription on the queryParams
like
this.route.queryParams
.skip(1)
.subscribe((res: DataParameter) => {})
It gives me the type error
this.route.queryParams.skip is not a function
same goes for the distincUntilChanged
operator. Is there something I'm missing, in the docs it says it returns an Observable.
Thanks!
Upvotes: 1
Views: 641
Reputation: 60377
Did you import the operator?
import 'rxjs/add/operator/distinctUntilChanged';
Because the rxjs package is very large, only a small subset of operators is imported by default.
As of today, pipeable operators are the new and preferred way of importing and using rxjs operators. For further information, have a look at the rxjs docs.
import { map, filter, scan } from 'rxjs/operators';
source$.pipe(
filter(x => x % 2 === 0),
map(x => x + x),
scan((acc, x) => acc + x, 0)
)
Upvotes: 3