@Naren Murali
I had hoped there was a way to use my package without having to install intl-tel-input unless you use the ReactiveFormField with the inputType set to 'phone'.
My package is used in numerous projects in my company, and only a subset of them need the intl-tel-input functionality.
If I understand you correctly, what I want is not possible and intl-tel-input will need to be installed in all projects which use my private package.
In regard to the @defer, are you suggesting wrapping the contents of the PhoneWrapper HTML instead of the contents of the @case('phone') block?
ReactiveFormField HTML:
@switch (inputType()) {
@case ('phone') {
<app-phone-wrapper
[control]="control()"
/>
}
<!-- bunch of other types -->
}
PhoneWrapper HTML:
@defer (on viewport) {
<intl-tel-input
[initOptions]="telOptions"
/>
}
I am on viewport is the event to use here, as I'd only want to load the intl-tel-input dependency when the PhoneWrapper is rendered.