docs: fix HttpClient sample

This commit is contained in:
WilliamKoza 2017-07-15 10:07:50 +02:00 committed by Alex Rickabaugh
parent c6ad212a98
commit 9f99f4fae2
1 changed files with 4 additions and 1 deletions

View File

@ -50,7 +50,10 @@ The `get()` method on `HttpClient` makes accessing this data straightforward.
```javascript ```javascript
@Component(...) @Component(...)
export class MyComponent implements NgOnInit { export class MyComponent implements OnInit {
results: string[];
// Inject HttpClient into your component or service. // Inject HttpClient into your component or service.
constructor(private http: HttpClient) {} constructor(private http: HttpClient) {}