2015-12-31 08:46:32 +02:00
|
|
|
// #docregion
|
2016-05-03 14:06:32 +02:00
|
|
|
import { Component } from '@angular/core';
|
2016-05-22 14:30:15 +01:00
|
|
|
import { Hero } from '../hero';
|
2015-12-31 08:46:32 +02:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'my-container',
|
|
|
|
template: `
|
|
|
|
<h1>Tour of Heroes</h1>
|
|
|
|
<hero-detail [hero]="hero"
|
|
|
|
(deleted)="heroDeleted($event)">
|
|
|
|
</hero-detail>
|
2016-09-27 09:22:38 +01:00
|
|
|
`
|
2015-12-31 08:46:32 +02:00
|
|
|
})
|
|
|
|
export class ContainerComponent {
|
|
|
|
hero = new Hero(1, 'Windstorm');
|
2016-06-08 01:06:25 +02:00
|
|
|
heroDeleted(hero: Hero) {
|
2016-04-11 15:36:53 +03:00
|
|
|
hero.name = 'Ex-' + hero.name;
|
2015-12-31 08:46:32 +02:00
|
|
|
}
|
|
|
|
}
|