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

153
Vistas
Angular Error: NG0100 when a directive use @Input to access ElementRef in ng-container

Minimal error version reproduction: https://stackblitz.com/edit/angular-zlh4ri

explanation:

  1. a component(comp1) use <ng-container><span #viewEl></span></ng-container>;
  2. another component(comp2) use <span #viewEl></span>;
  3. a commom directive try to access the #viewEl in 1/2 component;
  4. comp1 raize a error: NG0100: ExpressionChangedAfterItHasBeenCheckedError: Expression has changed after it was checked. Previous value: '[object Object]'. Current value: 'undefined'

How should I fix it? (Allow change structure, but note that the directive should keep a copy of viewEl because I need it

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You can make the ViewChild in Comp1 static: true to resolve query results before change detection runs.

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

Have a look at the docs for more information.

about 4 years ago · Juan Pablo Isaza Denunciar
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