@@ -13,10 +13,9 @@ import {MatPaginator, MatSort, MatTableDataSource} from '@angular/material';
13
13
import { DetailRow , PersonDetailDataSource } from './person-detail-data-source' ;
14
14
import { animate , state , style , transition , trigger } from '@angular/animations' ;
15
15
import { SelectionModel } from '@angular/cdk/collections' ;
16
- import { Observable } from 'rxjs/Observable' ;
17
- import 'rxjs/add/operator/distinctUntilChanged' ;
18
- import 'rxjs/add/operator/debounceTime' ;
19
- import 'rxjs/add/observable/fromEvent' ;
16
+ import { distinctUntilChanged } from 'rxjs/operators/distinctUntilChanged' ;
17
+ import { debounceTime } from 'rxjs/operators/debounceTime' ;
18
+ import { fromEvent } from 'rxjs/observable/fromEvent' ;
20
19
21
20
export type UserProperties = 'userId' | 'userName' | 'progress' | 'color' | undefined ;
22
21
@@ -88,13 +87,14 @@ export class TableDemo {
88
87
89
88
ngOnInit ( ) {
90
89
this . connect ( ) ;
91
- Observable . fromEvent ( this . filter . nativeElement , 'keyup' )
92
- . debounceTime ( 150 )
93
- . distinctUntilChanged ( )
94
- . subscribe ( ( ) => {
95
- this . paginatorForDataSource . pageIndex = 0 ;
96
- this . matTableDataSource . filter = this . filter . nativeElement . value ;
97
- } ) ;
90
+ fromEvent ( this . filter . nativeElement , 'keyup' )
91
+ . pipe (
92
+ debounceTime ( 150 ) ,
93
+ distinctUntilChanged ( )
94
+ ) . subscribe ( ( ) => {
95
+ this . paginatorForDataSource . pageIndex = 0 ;
96
+ this . matTableDataSource . filter = this . filter . nativeElement . value ;
97
+ } ) ;
98
98
}
99
99
100
100
/** Whether all filtered rows are selected. */
0 commit comments