Olá Nayanne!
Seguem dos códigos:
nova-transferencia.component.html
<section class="container">
<form class="formulario" (ngSubmit)="transferir()">
<h2 class="formulario__titulo">Nova Transferência</h2>
<div class="form-field">
<label class="form-field__label" for="valor">Valor</label>
<input class="form-field__input" id="valor" type="text" [(ngModel)]="valor" name="valor" />
</div>
<div class="form-field">
<label class="form-field__label" for="destino">Destino</label>
<input class="form-field__input" id="destino" type="text" [(ngModel)]="destino" name="destino" />
</div>
<div class="botao-wrapper">
<button class="botao" type="submit">Transferir</button>
</div>
</form>
</section>
nova-transferencia.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-nova-transferencia',
templateUrl: './nova-transferencia.component.html',
styleUrls: ['./nova-transferencia.component.scss'],
})
export class NovaTransferenciaComponent {
valor: number;
destino: number;
transferir() {
console.log('Solicitada nova transferência');
console.log('Valor: ', this.valor);
console.log('Destino: ', this.destino);
}
}
Att.,
Marcelo