Answers for "onchenge angular"

3

angular model change

<input type="checkbox"  (ngModelChange)="myModel=$event" [ngModel]="mymodel">
Posted by: Guest on July-30-2020
3

ngchange angular 8

import { Component } from '@angular/core';

@Component({
  selector: 'my-app',
  template: `
    <input type="number" [ngModel]="percent" (ngModelChange)="onPercentChange($event)" />
  `,
  styleUrls: [ './app.component.css' ]
})
export class AppComponent  {
  percent = 20;

  onPercentChange(percent: number) {
    console.log('here');  

    this.percent = percent;
  }
}
Posted by: Guest on May-04-2020

Browse Popular Code Answers by Language