Created
November 5, 2020 17:10
-
-
Save ManuelDeLeon/c1bf4a3f1172ae57901998c836cbf8c8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Component } from "@angular/core"; | |
@Component({ | |
selector: "app-add-numbers", | |
template: ` | |
<input type="number" [(ngModel)]="num1" /> + | |
<input type="number" [(ngModel)]="num2" /> | |
<button (click)="result = num1 + num2">Add</button> | |
<label>{{ result }}</label> | |
`, | |
}) | |
export class AppAddNumbersComponent { | |
num1 = 0; | |
num2 = 0; | |
result = 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment