import { Component } from '@angular/core' ; import { IonicPage , NavController , NavParams } from 'ionic-angular' ; import { PedidoDTO } from '../../models/pedido.dto' ; import { FormGroup , FormBuilder , Validators } from '@angular/forms' ; @ IonicPage ( ) @ Component ( { selector : 'page-payment' , templateUrl : 'payment.html' , } ) export class PaymentPage { pedido : PedidoDTO ; parcelas : number [ ] = [ 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ] ; formGroup : FormGroup ; constructor ( public navCtrl , public navParams , public formBuilder ) { this . pedido = this . navParams . get ( 'pedido' ) ; this . formGroup = this . formBuilder . group ( { numeroDeParcelas : [ 1 , Validators . required ] , "@type" : [ "pagamentoComCartao" , Validators . required ] } ) ; } nextPage ( ) { this . pedido . pagamento = this . formGroup . value ; this . navCtrl . setRoot ( 'OrderConfirmationPage' , { pedido : this . pedido } ) ; } }