O código não compila e exibe esse erro: "'Output' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@Output()'?"
import { Component, Output, EventEmitter } from '@angular/core';
@Component({
selector: 'app-nova-transferencia',
templateUrl: './nova-transferencia.component.html',
styleUrls: ['./nova-transferencia.component.scss'],
})
export class NovaTransferenciaComponent {
@Output aoTransferir = new EventEmitter<any>();
valor: number;
destino: number;
transferir() {
console.log('Solicitada nova transferência');
const valorEmitir = {valor: this.valor, destino: this.destino};
this.aoTransferir.emit(valorEmitir);
}
}
ERROR in src/app/nova-transferencia/nova-transferencia.component.ts:9:3 - error TS1329: 'Output' accepts too few arguments to be used as a decorator here. Did you mean to call it first and write '@Output()'?
9 @Output aoTransferir = new EventEmitter<any>();
~~~~~~~