mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
22 lines
431 B
TypeScript
22 lines
431 B
TypeScript
// #docregion
|
|
import { Component } from '@angular/core';
|
|
|
|
import { HEROES } from './hero';
|
|
|
|
@Component({
|
|
selector: 'app-hero-parent',
|
|
template: `
|
|
<h2>{{master}} controls {{heroes.length}} heroes</h2>
|
|
|
|
<app-hero-child
|
|
*ngFor="let hero of heroes"
|
|
[hero]="hero"
|
|
[master]="master">
|
|
</app-hero-child>
|
|
`
|
|
})
|
|
export class HeroParentComponent {
|
|
heroes = HEROES;
|
|
master = 'Master';
|
|
}
|
|
// #enddocregion
|