angular/aio/content/examples/component-styles/src/app/hero-controls.component.ts
dario-piotrowicz 0d19be1996 refactor(docs-infra): add types to all the aio examples buttons (#44557)
add types to all the buttons in the angular.io examples to encourage
the best practice of always including a type per button (regardless
to whether it is in a form or now)

PR Close #44557
2022-02-03 12:44:47 -08:00

25 lines
518 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 type="button" (click)="activate()">Activate</button>
`
})
// #enddocregion inlinestyles
export class HeroControlsComponent {
@Input() hero!: Hero;
activate() {
this.hero.active = true;
}
}