Skip to content

Commit 8319a57

Browse files
andrewseguinjelbourn
authored andcommitted
docs(table): fix http demo (#9528)
1 parent ff0662d commit 8319a57

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/material-examples/table-http/table-http-example.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Component, AfterViewInit, ViewChild} from '@angular/core';
1+
import {Component, OnInit, ViewChild} from '@angular/core';
22
import {HttpClient} from '@angular/common/http';
33
import {MatPaginator, MatSort, MatTableDataSource} from '@angular/material';
44
import {Observable} from 'rxjs/Observable';
@@ -17,21 +17,21 @@ import {switchMap} from 'rxjs/operators/switchMap';
1717
styleUrls: ['table-http-example.css'],
1818
templateUrl: 'table-http-example.html',
1919
})
20-
export class TableHttpExample implements AfterViewInit {
20+
export class TableHttpExample implements OnInit {
2121
displayedColumns = ['created', 'state', 'number', 'title'];
2222
exampleDatabase: ExampleHttpDao | null;
2323
dataSource = new MatTableDataSource();
2424

2525
resultsLength = 0;
26-
isLoadingResults = false;
26+
isLoadingResults = true;
2727
isRateLimitReached = false;
2828

2929
@ViewChild(MatPaginator) paginator: MatPaginator;
3030
@ViewChild(MatSort) sort: MatSort;
3131

3232
constructor(private http: HttpClient) {}
3333

34-
ngAfterViewInit() {
34+
ngOnInit() {
3535
this.exampleDatabase = new ExampleHttpDao(this.http);
3636

3737
// If the user changes the sort order, reset back to the first page.

0 commit comments

Comments
 (0)