import { Component, ChangeDetectorRef, ViewEncapsulation, Input, OnInit, EventEmitter, Output, ViewChild, ElementRef } from '@angular/core';
import { Router } from '@angular/router';
import { FinancingOptionsProperties } from '../../interfaces/financing-options-properties-interface';


@Component({
    selector: 'app-financing-options',
    templateUrl: './financing-options.component.html',
    styleUrls: ['./financing-options.component.scss'],
    encapsulation: ViewEncapsulation.None
})

export class FinancingOptionsComponent {
    @Input() financingOptionsItem: FinancingOptionsProperties;
    @Input() radioModel: string;
    @Output() radioSelection: EventEmitter<string> = new EventEmitter<string>();
    constructor(
        private router: Router,
        private ref: ChangeDetectorRef) {
    }

    onSelectionChange($event){
        this.radioSelection.emit(this.financingOptionsItem.radioValue);
    }
}
