
This commit updates the docs examples to be compatible with the `import-spacing` tslint rule. This is in preparation of updating the docs examples `tslint.json` to match the one generated for new Angular CLI apps in a future commit. PR Close #38143
25 lines
556 B
TypeScript
25 lines
556 B
TypeScript
// #docregion
|
|
import { Component } from '@angular/core';
|
|
|
|
@Component({
|
|
selector: 'app-vote-taker',
|
|
template: `
|
|
<h2>Should mankind colonize the Universe?</h2>
|
|
<h3>Agree: {{agreed}}, Disagree: {{disagreed}}</h3>
|
|
<app-voter *ngFor="let voter of voters"
|
|
[name]="voter"
|
|
(voted)="onVoted($event)">
|
|
</app-voter>
|
|
`
|
|
})
|
|
export class VoteTakerComponent {
|
|
agreed = 0;
|
|
disagreed = 0;
|
|
voters = ['Narco', 'Celeritas', 'Bombasto'];
|
|
|
|
onVoted(agreed: boolean) {
|
|
agreed ? this.agreed++ : this.disagreed++;
|
|
}
|
|
}
|
|
// #enddocregion
|