Skip to content
This repository was archived by the owner on Dec 4, 2017. It is now read-only.

docs(toh): add explanation for using the search box #2002

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions public/docs/_examples/toh-6/ts/app/dashboard.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
// #docplaster
// #docregion
// #docregion hero-search-component
import { Component, OnInit } from '@angular/core';
import { Router } from '@angular/router';

Expand All @@ -13,6 +14,7 @@ import { HeroSearchComponent } from './hero-search.component';
styleUrls: ['app/dashboard.component.css'],
directives: [HeroSearchComponent]
})
// #enddocregion hero-search-component
export class DashboardComponent implements OnInit {

heroes: Hero[] = [];
Expand Down
16 changes: 14 additions & 2 deletions public/docs/ts/latest/tutorial/toh-pt6.jade
Original file line number Diff line number Diff line change
Expand Up @@ -492,9 +492,21 @@ block observables-section
:marked
We load them all at once by importing `rxjs-extensions` in `AppComponent`.

+makeExample('toh-6/ts/app/app.component.ts', 'rxjs-extensions', 'app/app/app.component.ts')(format=".")
+makeExample('toh-6/ts/app/app.component.ts', 'rxjs-extensions', 'app/app.component.ts')(format=".")

:marked
### Adding the search component to the dashboard

We add the `HeroSearchComponent` to the bottom of the `DashboardComponent` template.

+makeExample('toh-6/ts/app/dashboard.component.html', null, 'dashboard.component.html')

:marked
And finally, we import the `HeroSearchComponent` and add it to the `directives` array.

+makeExcerpt('app/dashboard.component.ts', 'hero-search-component')

:marked
Finally, we add the `HeroSearchComponent` to the bottom of the `DashboardComponent`.
Run the app again, go to the *Dashboard*, and enter some text in the search box below the hero tiles.
At some point it might look like this.

Expand Down