Skip to content

[id] name change and support for Angular 9

Compare
Choose a tag to compare
@pasevin pasevin released this 08 Jun 09:40
986b6ee

I changed the way we get the id of the <input> inside validator. Previously it was passed with the FormControl value, which is not technically a part of input value which should be validated. So instead now I inject nativeElement into each control passed to the validator, where I can find and access input we're checking and get its id. This will allow in the future to get other nativeElement values we want to access.

While refactoring, I noticed another issue with [id] property which is that when used, it will create a duplicate id on ngx-intl-tel-input and child <input>. This ended up in invalid HTML and could create some other issues.

To avoid the above issue, I've renamed [id] property to [inputId].

!!! This version will break your implementation if you're already using [id] to identify your elements. !!!
To fix this just replace your [id] with [inputId]

Bonus:

  • Added support for Angular 9.