@@ -13,10 +13,9 @@ import {MatPaginator, MatSort, MatTableDataSource} from '@angular/material';
1313import { DetailRow , PersonDetailDataSource } from './person-detail-data-source' ;
1414import { animate , state , style , transition , trigger } from '@angular/animations' ;
1515import { 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' ;
2019
2120export type UserProperties = 'userId' | 'userName' | 'progress' | 'color' | undefined ;
2221
@@ -88,13 +87,14 @@ export class TableDemo {
8887
8988 ngOnInit ( ) {
9089 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+ } ) ;
9898 }
9999
100100 /** Whether all filtered rows are selected. */
0 commit comments