1import { Component } from '@angular/core';
2
3@Component({
4 selector: 'my-app',
5 template: `
6 <input type="number" [ngModel]="percent" (ngModelChange)="onPercentChange($event)" />
7 `,
8 styleUrls: [ './app.component.css' ]
9})
10export class AppComponent {
11 percent = 20;
12
13 onPercentChange(percent: number) {
14 console.log('here');
15
16 this.percent = percent;
17 }
18}
19