While looking for a way to disable Chrome autofill (link) I noticed that if instead of creating an input like this:
<input name="address" [(ngModel)]="address />
I create it like this:
<input **data-name**="address" [(ngModel)]="address />
The name of the ngModel control is still correctly set when I access it from the typescript class. For example:
this.ngModel.name // outputs "address"
Which means the form still works fine, even if I have not set the name attribute explicitly.
The question is, why is this working? is it intended behaviour? Doing this effectively disables the Chrome autofill (as there is no name attribute), but I'm afraid this might be a weird coincidence that it may be fixed in the future and break my form.