docs: Component Styles guide for CLI (#19791)
This commit is contained in:

committed by
Victor Berchet

parent
1d19d61970
commit
567cc26b8e
@ -0,0 +1,3 @@
|
||||
h1 {
|
||||
font-weight: normal;
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
import { Component, HostBinding } from '@angular/core';
|
||||
import { Hero } from './hero';
|
||||
|
||||
// #docregion
|
||||
@Component({
|
||||
selector: 'app-root',
|
||||
template: `
|
||||
<h1>Tour of Heroes</h1>
|
||||
<app-hero-main [hero]="hero"></app-hero-main>
|
||||
`,
|
||||
styleUrls: ['./hero-app.component.css']
|
||||
})
|
||||
export class HeroAppComponent {
|
||||
// #enddocregion
|
||||
hero = new Hero(
|
||||
'Human Torch',
|
||||
['Mister Fantastic', 'Invisible Woman', 'Thing']
|
||||
);
|
||||
|
||||
@HostBinding('class') get themeClass() {
|
||||
return 'theme-light';
|
||||
}
|
||||
// #docregion
|
||||
}
|
||||
// #enddocregion
|
@ -6,7 +6,8 @@ import { Hero } from './hero';
|
||||
selector: 'app-root',
|
||||
template: `
|
||||
<h1>Tour of Heroes</h1>
|
||||
<app-hero-main [hero]=hero></app-hero-main>`,
|
||||
<app-hero-main [hero]="hero"></app-hero-main>
|
||||
`,
|
||||
styles: ['h1 { font-weight: normal; }']
|
||||
})
|
||||
export class HeroAppComponent {
|
||||
|
Reference in New Issue
Block a user