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

docs(toh): add missing snippets #1649

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
6 changes: 5 additions & 1 deletion public/docs/_examples/toh-6/ts/app/hero-detail.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
// #docplaster
// #docregion
// #docregion, variables-imports
import { Component, EventEmitter, Input, OnInit, Output } from '@angular/core';

// #enddocregion variables-imports
import { RouteParams } from '@angular/router-deprecated';

import { Hero } from './hero';
Expand All @@ -11,11 +13,13 @@ import { HeroService } from './hero.service';
templateUrl: 'app/hero-detail.component.html',
styleUrls: ['app/hero-detail.component.css']
})
// #docregion variables-imports
export class HeroDetailComponent implements OnInit {
@Input() hero: Hero;
@Output() close = new EventEmitter();
error: any;
navigated = false; // true if navigated here
// #enddocregion variables-imports

constructor(
private heroService: HeroService,
Expand Down
5 changes: 5 additions & 0 deletions public/docs/ts/latest/tutorial/toh-pt6.jade
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,11 @@ code-example(language="bash").
Loading heroes using `Http` required no changes outside of `HeroService`, but we added a few new features as well.
In the following section we will update our components to use our new methods to add, edit and delete heroes.

Before we can add those methods, we need to initialize some variables with their respective imports.

+makeExample('toh-6/ts/app/hero-detail.component.ts', 'variables-imports', 'app/hero-detail.component.ts')(format=".")

:marked
### Add/Edit in the *HeroDetailComponent*

We already have `HeroDetailComponent` for viewing details about a specific hero.
Expand Down