angular-docs-cn/public/docs/_examples/hierarchical-dependency-inj.../ts/app/hero-card.component.ts

17 lines
299 B
TypeScript

// #docregion
import {Component, Input} from 'angular2/core';
import {Hero} from './hero';
@Component({
selector: 'hero-card',
template: `
<div>
<span>Name:</span>
<span>{{hero.name}}</span>
</div>`
})
export class HeroCardComponent {
@Input() hero: Hero;
}
// #docregion