From 7c9ff12a76ccb5af1384ef0367ea9401a73903e8 Mon Sep 17 00:00:00 2001 From: William KOZA Date: Sun, 1 Jan 2017 09:06:16 +0100 Subject: [PATCH] docs(server-communication) Don't use constructor, but rather ngOnInit (#3046) --- .../ts/app/wiki/wiki-smart.component.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/public/docs/_examples/server-communication/ts/app/wiki/wiki-smart.component.ts b/public/docs/_examples/server-communication/ts/app/wiki/wiki-smart.component.ts index 97ca33e1c0..e23138a560 100644 --- a/public/docs/_examples/server-communication/ts/app/wiki/wiki-smart.component.ts +++ b/public/docs/_examples/server-communication/ts/app/wiki/wiki-smart.component.ts @@ -1,7 +1,7 @@ /* tslint:disable: member-ordering forin */ // #docplaster // #docregion -import { Component } from '@angular/core'; +import { Component, OnInit } from '@angular/core'; import { Observable } from 'rxjs/Observable'; // #docregion import-subject import { Subject } from 'rxjs/Subject'; @@ -15,7 +15,7 @@ import { WikipediaService } from './wikipedia.service'; templateUrl: 'wiki.component.html', providers: [ WikipediaService ] }) -export class WikiSmartComponent { +export class WikiSmartComponent implements OnInit { title = 'Smarter Wikipedia Demo'; fetches = 'Fetches when typing stops'; items: Observable; @@ -25,7 +25,9 @@ export class WikiSmartComponent { search(term: string) { this.searchTermStream.next(term); } // #enddocregion subject - constructor (private wikipediaService: WikipediaService) { + constructor (private wikipediaService: WikipediaService) {} + + ngOnInit() { // #docregion observable-operators this.items = this.searchTermStream .debounceTime(300)