2015-12-16 22:38:07 -05:00
|
|
|
// #docplaster
|
|
|
|
// #docregion
|
|
|
|
// #docregion v1
|
2016-05-03 08:06:32 -04:00
|
|
|
import { Component, Input } from '@angular/core';
|
2016-03-24 08:31:27 -04:00
|
|
|
|
2015-12-16 22:38:07 -05:00
|
|
|
// #enddocregion v1
|
|
|
|
// #docregion hero-import
|
2016-05-03 08:06:32 -04:00
|
|
|
import { Hero } from './hero';
|
2015-12-16 22:38:07 -05:00
|
|
|
// #enddocregion hero-import
|
2015-12-14 23:05:13 -05:00
|
|
|
|
2015-12-16 22:38:07 -05:00
|
|
|
// #docregion v1
|
2015-12-14 23:05:13 -05:00
|
|
|
@Component({
|
|
|
|
selector: 'my-hero-detail',
|
2016-05-03 08:06:32 -04:00
|
|
|
// #enddocregion v1
|
2015-12-16 22:38:07 -05:00
|
|
|
// #docregion template
|
2015-12-14 23:05:13 -05:00
|
|
|
template: `
|
|
|
|
<div *ngIf="hero">
|
|
|
|
<h2>{{hero.name}} details!</h2>
|
|
|
|
<div><label>id: </label>{{hero.id}}</div>
|
|
|
|
<div>
|
|
|
|
<label>name: </label>
|
|
|
|
<input [(ngModel)]="hero.name" placeholder="name"/>
|
|
|
|
</div>
|
|
|
|
</div>
|
2016-03-24 08:31:27 -04:00
|
|
|
`
|
2015-12-16 22:38:07 -05:00
|
|
|
// #enddocregion template
|
2016-06-07 19:06:25 -04:00
|
|
|
// #docregion v1
|
2015-12-14 23:05:13 -05:00
|
|
|
})
|
|
|
|
export class HeroDetailComponent {
|
2015-12-16 22:38:07 -05:00
|
|
|
// #enddocregion v1
|
2016-03-24 08:31:27 -04:00
|
|
|
// #docregion hero-input
|
2016-06-07 19:06:25 -04:00
|
|
|
@Input()
|
|
|
|
// #docregion hero
|
2015-12-23 12:42:57 -05:00
|
|
|
hero: Hero;
|
2016-06-07 19:06:25 -04:00
|
|
|
// #enddocregion hero
|
2016-03-24 08:31:27 -04:00
|
|
|
// #enddocregion hero-input
|
2015-12-16 22:38:07 -05:00
|
|
|
// #docregion v1
|
2015-12-14 23:05:13 -05:00
|
|
|
}
|
2015-12-16 22:38:07 -05:00
|
|
|
// #enddocregion v1
|