import { Component, Output } from '@angular/core';
import { EventEmitter } from 'events';
@Component({
selector: 'app-nova-transferencia',
templateUrl: './nova-transferencia.component.html',
styleUrls: ['./nova-transferencia.component.scss']
})
export class NovaTransferenciaComponent {
@Output() aoTransferir = new EventEmitter<any>();
title = 'bytebank';
valor = 0;
destino = 0;
transferir(): void{
console.log('Solicitação de nova transferência!');
const transferencia = {valor: this.valor, destino: this.destino}
this.aoTransferir.emit(transferencia);
}
}
Erro:
@Output aoTransferir not initialized in 'NovaTransferenciaComponent'.
at listenerInternal (core.js:14981)
at Module.ɵɵlistener (core.js:14829)
at AppComponent_Template (app.component.html:1)
at executeTemplate (core.js:9323)
at renderView (core.js:9130)
at renderComponent (core.js:10405)
at renderChildComponents (core.js:8995)
at renderView (core.js:9155)
at ComponentFactory$1.create (core.js:24857)
at ApplicationRef.bootstrap (core.js:29235)