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

152
Views
Error angular: NG0100 cuando una directiva usa @Input para acceder a ElementRef en ng-container

Reproducción de versión de error mínimo: https://stackblitz.com/edit/angular-zlh4ri

explicación:

  1. un componente (comp1) usa <ng-container><span #viewEl></span></ng-container> ;
  2. otro componente (comp2) usa <span #viewEl></span> ;
  3. una directiva común intenta acceder al componente #viewEl en 1/2;
  4. comp1 genera un error: NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '[object Object]'. Current value: 'undefined'

¿Cómo debo arreglarlo? (Permitir cambiar la estructura, pero tenga en cuenta que la directiva debe conservar una copia de viewEl porque la necesito

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

0

Puede hacer que ViewChild en Comp1 static: true para resolver los resultados de la consulta antes de que se ejecute la detección de cambios.

 @ViewChild('viewEl', { read: ElementRef, static: true })

Eche un vistazo a los documentos para obtener más información.

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!