mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
0d19be1996
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
27 lines
563 B
TypeScript
27 lines
563 B
TypeScript
// #docregion
|
|
import { Component } from '@angular/core';
|
|
|
|
@Component({
|
|
selector: 'app-version-parent',
|
|
template: `
|
|
<h2>Source code version</h2>
|
|
<button type="button" (click)="newMinor()">New minor version</button>
|
|
<button type="button" (click)="newMajor()">New major version</button>
|
|
<app-version-child [major]="major" [minor]="minor"></app-version-child>
|
|
`
|
|
})
|
|
export class VersionParentComponent {
|
|
major = 1;
|
|
minor = 23;
|
|
|
|
newMinor() {
|
|
this.minor++;
|
|
}
|
|
|
|
newMajor() {
|
|
this.major++;
|
|
this.minor = 0;
|
|
}
|
|
}
|
|
// #enddocregion
|