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?