I know that there are questions relating this topic and I took a look at the docs but I couldn't understand how to use outputs.
I have a child component with this @Output
//here I define the Ouput on the child component
@Output() turvo: EventEmitter<boolean> = new EventEmitter();
//here I emit the event on the child component
ngOnInit() {
this.turvo.emit(false);
}
The parent component
//here I listen to the emitted event on the parent
<div (turvo)="atribuirTurvoDoFilho($event)"></div>
//here is the function that should be executed on the parent.
public atribuirTurvoDoFilho(data) {
console.log("I will never execute :(");
this.turvo = data;
}
I got no errors but no communication occurs.