Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <input matInput (keyup)="applyFilter($event.target.value)" placeholder="Search">
- applyFilter(filterValue: string) {
- filterValue = filterValue.trim();
- filterValue = filterValue.toLowerCase();
- this.scanService.getFilteringScans(filterValue).subscribe(response => {
- this.scans = response.results;
- this.next = response.next;
- this.previous = response.previous;
- this.scans_length = response.count;
- this.dataSource = new MatTableDataSource(this.scans.map(function(obj){return new ScanDetails(obj)}));
- });
- this.dataSource.filter = filterValue;
- }
- getFilteringScans(param): Observable<ScanList> {
- return this.http.get<ScanList>(this.scansUrl + '?search=' + param).pipe(
- map(response => response),
- catchError(this.handleError)
- );
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement