tanansatpal / ngx-mat-intl-tel-input

MIT License
62 stars 114 forks source link

Unable to clear the ngx-mat-intl-tel-input after form submit in angular 9 #96

Open derwing opened 3 years ago

derwing commented 3 years ago

This is my html -

image

I use this.addressForm.reset(); --- for reset my form All fields are cleaned less ngx-mat-intl-tel-input

isax5 commented 3 years ago

you can reset the component directly

@ViewChild('phoneInput')
phoneInput: NgxMatIntlTelInputComponent;

public resetForm(): void {
  this.form.reset();
  this.phoneInput.reset();
}
derwing commented 3 years ago

Thanks!

rbalet commented 1 year ago

Will be fixed once this pull request have been merged.

Or already online on this library

hobojoe commented 1 year ago

Will be fixed once this pull request have been merged.

Or already online on this library

Hi @rbalet , thanks for the link. I'm trying to use your library but I'm facing an error:

Error: node_modules/ngx-mat-input-tel/lib/ngx-mat-input-tel.component.d.ts:89:97 - error TS2344: Type '{ preferredCountries: { alias: "preferredCountries"; required: false; }; enablePlaceholder: { alias: "enablePlaceholder"; required: false; }; inputPlaceholder: { alias: "inputPlaceholder"; required: false; }; ... 10 more ...; disabled: { ...; }; }' does not satisfy the constraint '{ [key: string]: string; }'.
  Property '"preferredCountries"' is incompatible with index signature.
    Type '{ alias: "preferredCountries"; required: false; }' is not assignable to type 'string'.

I am asking here since I cannot post an issue directly on your library's github.

I tried with the latest version and also with the first one > same error.

I am using angular 15.1.1

Could you help me?

rbalet commented 1 year ago

Hi @hobojoe. You shall now be able to create an issue on my fork. May be cleaner that way :).

But as I can read what you've posted, it may be due to my code enforcing you to pass some variable. Since I did us strictTemplate: true in the tsconfig

I removed it and enhanced the code a little bit in the latest v16.1.7

Let me now

hobojoe commented 1 year ago

Hi @hobojoe. You shall now be able to create an issue on my fork. May be cleaner that way :).

But as I can read what you've posted, it may be due to my code enforcing you to pass some variable. Since I did us strictTemplate: true in the tsconfig

I removed it and enhanced the code a little bit in the latest v16.1.7

Let me now

Hi, unfortunately the error persisted. I've just created an issue on your own repo. Thanks!