Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

194
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!