import {Component, Input, OnInit} from '@angular/core'; import {FilterInfo} from '../types/filter-info'; import {FiltersDataService} from '../providers/filters-data.service'; import {SelectedFiltersDataService} from '../providers/selected-filters-data.service'; @Component({ selector: 'ics-radio', templateUrl: './radio.component.html', styleUrls: ['./radio.component.scss'] }) export class RadioComponent implements OnInit { @Input() filterInfo: FilterInfo; @Input() filterData: any[]; selectedData: any; constructor(private filtersDataService: FiltersDataService, private fs: SelectedFiltersDataService) { } ngOnInit() { this.selectedData = this.filterData[0].value; this.onOptionChange(); // this.filterInfo.resolve(true); } onOptionChange() { this.fs.storeSelectedData(this.filterInfo.name, this.selectedData); } }