79822365

Date: 2025-11-17 13:49:38
Score: 3
Natty:
Report link

@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.

Reasons:
  • RegEx Blacklisted phrase (1): I want
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • User mentioned (1): @Naren
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: Alex Davis