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

183
Vistas
Angular: How to Implicitly infer types when assigning function to an output of a child component

I would like to know if it is possible to implicitly infer the type from the given example of components below :

@Component({
selector:'child',
template:`<button (click)="triggerChange()">Click Me</button>`
})
export class ChildComponent {
   @Output() inputchange = new EventEmitter<string>();

   triggerChange(){
      this.inputchange.emit('Hello!');
   }
}

while reading this output in the parent component

@Component({
template:`<child (inputchange)="childChanged($event)"></child>`
})
export class ParentComponent {

   childChanged(event){
      console.log(event);
   }

}

Currently there is no possible way to implicitly know the type of the output parameter, except if we explicitly define it ( childChanged(event: string){ ... })

So the my question is is there any way to implicitly infer, or know the type of the incoming parameter (or variable) in this case?

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