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