I have installed angular material and cdk for angular 14 version
i want to user import { NgxMatIntlTelInputModule } from "ngx-mat-intl-tel-input";
when i import this library its geeting error. the error message
'"ngx-mat-intl-tel-input"' has no exported member named 'NgxMatIntlTelInputModule'. Did you mean 'NgxMatIntlTelInputComponent'?
How to use ngx-mat-intl-tel-input for use phone number validation with the country code in angular 14 the demo url : https://stackblitz.com/edit/ngx-mat-intl-tel-inpu-demo
how to phone number blank or clear when we change country code in this ngx-mat-intl-tel-input as per below code
<ngx-mat-intl-tel-input
[preferredCountries]="['in', 'us']"
[enablePlaceholder]="true"
[enableSearch]="true"
formControlName="phone"
name="phone" #phone
>
</ngx-mat-intl-tel-input>
</mat-form-field>
this.myForm = this.fb.group({
name: 'User',
phone: new FormControl('+93 234234243',[Validators.required])
});
I believe that you are installing ngx-mat-intl-tel-input with version 5.0.0 which is the latest version that supports Angular 14.
It has been migrated to the standalone component. And the
NgxMatIntlTelInputModule
is no longer available.Thus, you need to import the
NgxMatIntlTelInputComponent
in your component assuming that your component is a standalone component.If your components are not standalone, you need to import the
NgxMatIntlTelInputComponent
in thedeclarations
array in the root module of your Angular application.