import { Component, OnInit, Input , EventEmitter, Output} from '@angular/core'; import { MatRadioButton, MatRadioChange } from '@angular/material'; @Component({ selector: 'rdp-radio-editor', templateUrl: './rdp-radio-editor.component.html', styleUrls: ['./rdp-radio-editor.component.scss'] }) export class RdpRadioEditorComponent implements OnInit { @Input() rowdata :any; @Input() columntitle: any @Input() data: any[]; @Output() changedColumnValue = new EventEmitter(); columnValue: any; selectedValue : any; constructor() { } ngOnInit() { if (this.rowdata != null || this.rowdata != undefined) { let rowObj = JSON.parse(this.rowdata); let column = this.columntitle; this.columnValue = rowObj[column]; } else { this.columnValue = null; } this.selectedValue = this.columnValue; console.log(" this.selected :::", this.selectedValue); } onChange(changedValue){ this.changedColumnValue.emit(changedValue.value); } }