angularinputngmodel

(ngModelChange) works fine without adding [ngModel]?


I used ngModelChange without ngModel in an input in a form , it works fine , it's not supposed to work though, any explanation ?

the code

1

i expected it won't work without the ngModel but it works fine


Solution

  • You are using the formControlName Directive

    It has a @Output('ngModelChange') update: EventEmitter but its marked as deprecated since v6 so there is a chance it wont work with the next updateds.