angular/aio/content/examples/component-styles/src/app/hero-controls.component.ts
Kristiyan Kostadinov e86a1d3441 docs: make all examples compatible with strict mode (#41999)
Turns on the `strict` compiler flag and resolves the compilation errors in the various AIO examples.

PR Close #41999
2021-05-17 10:42:18 -07:00

25 lines
504 B
TypeScript

import { Component, Input } from '@angular/core';
import { Hero } from './hero';
// #docregion inlinestyles
@Component({
selector: 'app-hero-controls',
template: `
<style>
button {
background-color: white;
border: 1px solid #777;
}
</style>
<h3>Controls</h3>
<button (click)="activate()">Activate</button>
`
})
// #enddocregion inlinestyles
export class HeroControlsComponent {
@Input() hero!: Hero;
activate() {
this.hero.active = true;
}
}