2016-02-02 14:39:34 +01:00
|
|
|
// #docregion
|
2016-04-27 11:28:22 -07:00
|
|
|
import {Component, Input} from '@angular/core';
|
2016-02-02 14:39:34 +01:00
|
|
|
import {Hero} from './hero';
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'hero-child',
|
|
|
|
template: `
|
|
|
|
<h3>{{hero.name}} says:</h3>
|
|
|
|
<p>I, {{hero.name}}, am at your service, {{masterName}}.</p>
|
|
|
|
`
|
|
|
|
})
|
|
|
|
export class HeroChildComponent {
|
|
|
|
@Input() hero: Hero;
|
|
|
|
@Input('master') masterName: string;
|
|
|
|
}
|
|
|
|
// #enddocregion
|