### File

`modules/payments-component/src/deliveries/address-delivery/address-delivery.component.ts`

### Description

Address delivery form

### Metadata

selector | `address-delivery`
styleUrls | `address-delivery.component.scss`
templateUrl | `address-delivery.component.html`

### Outputs

`addressDeliverySaved` | Emit form when user finish to fill in it `$event` type: `EventEmitter`

### Constructor

`constructor(fb: any)`

### Methods

saveDelivery
`saveDelivery()`
Emit new form Returns: `void`

### Properties

Public addressDeliveryForm
`addressDeliveryForm: `any` </bcode>`
FormGroup of address delivery form

Public countries
`countries: `any` </bcode>`

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

    /**
     * Address delivery form
     */
    @Component({
        selector: 'address-delivery',
        templateUrl: './address-delivery.component.html',
        styleUrls: ['address-delivery.component.scss']
    })
    export class AddressDeliveryComponent implements OnInit {

        /**
         * FormGroup of address delivery form
         */
        public addressDeliveryForm: FormGroup;

        /**
         * Emit form when user finish to fill in it
         */
        @Output() addressDeliverySaved = new EventEmitter();
        public countries;
        constructor(private fb: FormBuilder) {
            this.addressDeliveryForm = this.fb.group({
                country: '',
                state: '',
                zipCode: '',
                city: '',
                addrLine1: '',
                name: '',
                email: '',
                phoneNumber: ''
            });
         }

        ngOnInit() {
            this.countries = countries;

        }

        /**
         * Emit new form
         */
        saveDelivery() {
            this.addressDeliverySaved.next(this.addressDeliveryForm.value);
        }
    }

# results matching ""

# No results matching ""