2016-06-07 16:45:13 -07:00

27 lines
632 B
TypeScript

import { Component, HostBinding } from '@angular/core';
import { Hero } from './hero';
import { HeroAppMainComponent } from './hero-app-main.component';
// #docregion
@Component({
selector: 'hero-app',
template: `
<h1>Tour of Heroes</h1>
<hero-app-main [hero]=hero></hero-app-main>`,
styles: ['h1 { font-weight: normal; }'],
directives: [HeroAppMainComponent]
})
export class HeroAppComponent {
// #enddocregion
hero = new Hero(
'Human Torch',
['Mister Fantastic', 'Invisible Woman', 'Thing']
);
@HostBinding('class') get themeClass() {
return 'theme-light';
}
// #docregion
}
// #enddocregion