angular-cn/public/docs/_examples/cb-component-communication/ts/app/hero-parent.component.ts

22 lines
507 B
TypeScript
Raw Normal View History

// #docregion
import {Component} from 'angular2/core';
import {HeroChildComponent} from './hero-child.component';
import {HEROES} from './hero';
@Component({
selector: 'hero-parent',
template: `
<h2>{{master}} controls {{heroes.length}} heroes</h2>
<hero-child *ngFor="#hero of heroes"
[hero]="hero"
[master]="master">
</hero-child>
`,
directives: [HeroChildComponent]
})
export class HeroParentComponent {
heroes = HEROES;
master: string = 'Master';
}
// #enddocregion