angular input onchange
<input (change)="saverange()"/>
angular input onchange
<input (change)="saverange()"/>
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;
}
}
angular onChange onChanges SimpleChanges
export class MyClassName implements OnInit,OnChanges {
@Input() documents: Document[] = [];
.....
ngOnChanges(changes: SimpleChanges){
console.log("changes ", changes)
if(changes.documents){
console.log("changes2 ", changes)
}
}
javascript ng-change get previous value
//user.id passed to updateValue will be old value
<select ng-change="updateValue('{{user.id}}')"
ng-model="user.id" ng-options="user.id as user.name for user in users">
</select>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us