From 8319a5701bd05d84581570dc87c91baa1f7be5d7 Mon Sep 17 00:00:00 2001 From: Andrew Seguin Date: Wed, 24 Jan 2018 14:33:00 -0800 Subject: [PATCH] docs(table): fix http demo (#9528) --- src/material-examples/table-http/table-http-example.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/material-examples/table-http/table-http-example.ts b/src/material-examples/table-http/table-http-example.ts index 67f293a49978..89bed0f4f26c 100644 --- a/src/material-examples/table-http/table-http-example.ts +++ b/src/material-examples/table-http/table-http-example.ts @@ -1,4 +1,4 @@ -import {Component, AfterViewInit, ViewChild} from '@angular/core'; +import {Component, OnInit, ViewChild} from '@angular/core'; import {HttpClient} from '@angular/common/http'; import {MatPaginator, MatSort, MatTableDataSource} from '@angular/material'; import {Observable} from 'rxjs/Observable'; @@ -17,13 +17,13 @@ import {switchMap} from 'rxjs/operators/switchMap'; styleUrls: ['table-http-example.css'], templateUrl: 'table-http-example.html', }) -export class TableHttpExample implements AfterViewInit { +export class TableHttpExample implements OnInit { displayedColumns = ['created', 'state', 'number', 'title']; exampleDatabase: ExampleHttpDao | null; dataSource = new MatTableDataSource(); resultsLength = 0; - isLoadingResults = false; + isLoadingResults = true; isRateLimitReached = false; @ViewChild(MatPaginator) paginator: MatPaginator; @@ -31,7 +31,7 @@ export class TableHttpExample implements AfterViewInit { constructor(private http: HttpClient) {} - ngAfterViewInit() { + ngOnInit() { this.exampleDatabase = new ExampleHttpDao(this.http); // If the user changes the sort order, reset back to the first page.