Patrice Chalin ef66e38e54 docs(dev guide): Update 'Component Styles' prose (#1320)
Reowork Ts prose and add Dart prose/code

+ Updates to docs and example code

(Starting point for Dart code was taken from #1171.)
2016-05-10 08:51:23 +01:00

27 lines
631 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