import { FormGroup, FormBuilder } from '@angular/forms';
import { Component, OnInit, Output, EventEmitter } from '@angular/core';

@Component({
    selector: 'paypal',
    templateUrl: './paypal.component.html',
    styleUrls: ['paypal.component.scss']
})
export class PaypalComponent implements OnInit {
    
    public paypalForm: FormGroup;
    @Output() public formSaved = new EventEmitter();
    constructor(private fb: FormBuilder) {
        this.paypalForm = fb.group({
            paymentMethod: 'PAYPAL',
            deliveryRequired: false,
            details: "Some details"
        });
     }

     nextStep(){
        this.formSaved.next(this.paypalForm.value);
    }

    ngOnInit() { }
}