This repository was archived by the owner on Dec 4, 2017. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
public/docs/_examples/server-communication/ts/app/wiki Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1
1
/* tslint:disable: member-ordering forin */
2
2
// #docplaster
3
3
// #docregion
4
- import { Component } from '@angular/core' ;
4
+ import { Component , OnInit } from '@angular/core' ;
5
5
import { Observable } from 'rxjs/Observable' ;
6
6
// #docregion import-subject
7
7
import { Subject } from 'rxjs/Subject' ;
@@ -15,7 +15,7 @@ import { WikipediaService } from './wikipedia.service';
15
15
templateUrl : 'wiki.component.html' ,
16
16
providers : [ WikipediaService ]
17
17
} )
18
- export class WikiSmartComponent {
18
+ export class WikiSmartComponent implements OnInit {
19
19
title = 'Smarter Wikipedia Demo' ;
20
20
fetches = 'Fetches when typing stops' ;
21
21
items : Observable < string [ ] > ;
@@ -25,7 +25,9 @@ export class WikiSmartComponent {
25
25
search ( term : string ) { this . searchTermStream . next ( term ) ; }
26
26
// #enddocregion subject
27
27
28
- constructor ( private wikipediaService : WikipediaService ) {
28
+ constructor ( private wikipediaService : WikipediaService ) { }
29
+
30
+ ngOnInit ( ) {
29
31
// #docregion observable-operators
30
32
this . items = this . searchTermStream
31
33
. debounceTime ( 300 )
You can’t perform that action at this time.
0 commit comments