1
- import { Component , AfterViewInit , ViewChild } from '@angular/core' ;
1
+ import { Component , OnInit , ViewChild } from '@angular/core' ;
2
2
import { HttpClient } from '@angular/common/http' ;
3
3
import { MatPaginator , MatSort , MatTableDataSource } from '@angular/material' ;
4
4
import { Observable } from 'rxjs/Observable' ;
@@ -17,21 +17,21 @@ import {switchMap} from 'rxjs/operators/switchMap';
17
17
styleUrls : [ 'table-http-example.css' ] ,
18
18
templateUrl : 'table-http-example.html' ,
19
19
} )
20
- export class TableHttpExample implements AfterViewInit {
20
+ export class TableHttpExample implements OnInit {
21
21
displayedColumns = [ 'created' , 'state' , 'number' , 'title' ] ;
22
22
exampleDatabase : ExampleHttpDao | null ;
23
23
dataSource = new MatTableDataSource ( ) ;
24
24
25
25
resultsLength = 0 ;
26
- isLoadingResults = false ;
26
+ isLoadingResults = true ;
27
27
isRateLimitReached = false ;
28
28
29
29
@ViewChild ( MatPaginator ) paginator : MatPaginator ;
30
30
@ViewChild ( MatSort ) sort : MatSort ;
31
31
32
32
constructor ( private http : HttpClient ) { }
33
33
34
- ngAfterViewInit ( ) {
34
+ ngOnInit ( ) {
35
35
this . exampleDatabase = new ExampleHttpDao ( this . http ) ;
36
36
37
37
// If the user changes the sort order, reset back to the first page.
0 commit comments