I am using angular 4 and i am checking is any value is changed by user or not? In my page there are more than 100 control(textbox ,dropdown and editable grid)
I need to check only if any value is changed or not. For that i am using below code but it is called multiple times while pageload.
How i can avoid this.i need valuechange will execute only on when user change any value.
import { Component, OnInit, ViewChild, AfterViewInit, HostListener, OnChanges, DoCheck, AfterViewChecked,OnDestroy } from "@angular/core";
@ViewChild('fromNote') fnotes;
ngAfterViewInit() {
this.fnotes.valueChanges.subscribe(val => {
alert('changed');
});
}
.next()onvalueChangesoffnotes, only when the user changes the value. So thesubscribemethod gets the value when the use changes the value.#fromNote?