webcat12345 / ngx-intl-tel-input

Phone number input field to support international numbers, Angular
MIT License
213 stars 335 forks source link

Cannot find control with name: 'phone' #381

Open camit-dev21 opened 3 years ago

camit-dev21 commented 3 years ago

Hello Everyone. How are you doing? I have an error when I use this module.

<ngx-intl-tel-input [cssClass]="'form-control-branded'" [preferredCountries]="preferredCountries" [enableAutoCountrySelect]="false" [searchCountryFlag]="true" [enablePlaceholder]="false" [searchCountryField]="searchCountryField" [selectFirstCountry]="false" [selectedCountryISO]="selectedCountry" [maxLength]="15" [tooltipField]="tooltipField" [phoneValidation]="true" [id]="'phone'" formControlName="phone" name="phone"> When I inspected browser console, there was an issue. Cannot find control with name: 'phone' It would be great if anyone can help me. Thank you

pratikq23 commented 3 years ago

Check your form control name. This example may be helpful for you https://stackblitz.com/edit/ngx-intl-tel-input-demo-ng-10

thieba commented 3 years ago

I have the same error with Angular 12. formControlName="phone" works on a normal input but not on the ngx-intl-tel-input, also tried object bindings like but didn't work.