After updating my Angular 5 project into Angular 6 following Angular update guide i'm getting.
Property 'debounceTime' does not exist on type 'Observable<any>'
after running ng update
my all components lost the debounceTime import
. But i put it back manually but that didn't fixed the issue.
example.component.ts
import { debounceTime } from 'rxjs/operators';
//Added after removed by ng update
this.searchField.valueChanges
.debounceTime(800)
.distinctUntilChanged()
.subscribe(term => {
this.searchText = term;
this.getAllDoctors();
},
I really want to understand whats going on here.
You need to use pipe operator.
this.searchField.valueChanges
.pipe(debounceTime(800),
distinctUntilChanged()
)
.subscribe(term => {
this.searchText = term;
this.getAllDoctors();
}),
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With