Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

193
Vistas
How to get input of ngcontent template?

In my application, I have multiple input component, and in some case, I would like to have a wrapper around those component to add some functionality.

Every input component is different some have some doesn't (like toggle).

I would like for the wrapper to get the HTML Input Element of the component he wrap IF there is one, or just get undefined if there is not.

Here a simplified [stackblitz][1]

I CAN'T use a reference #id inside all my inputs, I just would like a way to check the content, and get the Input Element.

Sadly, this do not work

@ContentChild(HTMLInputElement) input: ElementRef<HTMLInputElement>;

Is it possible ? or I need to find another way [1]: https://stackblitz.com/edit/angular-ivy-ks4mmt?file=src/app/input-wrapper/input-wrapper.component.ts

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda