How to check for changes in form in Angular 2 using

前端 未结 10 714
轻奢々
轻奢々 2020-12-08 13:53

I have a form with few data fields and two buttons.I want to enable the buttons only if the user makes some changes to the form. I have tried using:

this.for         


        
10条回答
  •  再見小時候
    2020-12-08 14:33

    I guess you can just ignore the first change

    this.form.valueChanges
    .skip(1)
    .subscribe(data => console.log('form changes', data));
    

    Hint: import the skip operator

提交回复
热议问题