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

200
Views
Enlace angular solo cuando el mouse se mueve

Tengo un problema muy raro. Tengo una entrada y quiero mostrar un botón solo cuando la entrada tiene un valor. Solo funciona si muevo el mouse.

 <input class="form-control" type="text" placeholder="hello there..." #helloInput > {{helloInput.value}} --> not shows until mouse is moving <button class="btn btn-success" *ngIf="helloInput.value" >Show me</button>

es muy raro ¿Alguna idea?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Vista de actualizaciones angulares solo llamando a la detección de cambios. La mayoría de las veces sucede automáticamente debido a las llamadas Event listeners/XHR/setTimeout/setInterval.

En su ejemplo, no hay ningún detector de eventos conocido por Angular. Como se actualiza con mousemove, hay un oyente y Angular lo detectó.

Para actualizar su vista sobre cualquier cambio de valor de entrada, simplemente puede agregar un detector de eventos input vacío:

 <input class="form-control" type="text" placeholder="hello there..." #helloInput (input)="0" <=============== this one >
about 4 years ago · Juan Pablo Isaza Report
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!