angular 6 warning for using formControlName and ngModel
Now you can find the documentation here:
https://angular.io/api/forms/FormControlName#use-with-ngmodel-is-deprecated
So you have 3 options:
use Reactive forms
use Template driven forms
silence warning (not recommended)
<!-- language: lang-ts -->
imports: [
ReactiveFormsModule.withConfig({warnOnNgModelWithFormControl: 'never'});
]
Remove [(ngModel)]
from every field within formGroup contains formControlName
and set value in controller class as follows simply this.form.get('first').setValue('some value');
do not close or silence warnings explicitly