This is a parent component template file. It is not giving any problem
app.component.html
<div>
<input type="text" [(ngModel)]="electronics.light" name="light" placeholder="light">
<input type="text" [(ngModel)]="electronics.fan" name="fan" placeholder="fan">
</div>
<button (click)="display();">Display</button>
<div *ngIf="flag">
<app-electronics-layout [images]="images" [electronicsObj]="electronics"></app-electronics-layout>
</div>
This is some part of the child component ts file where the display1() method is called on button click to verify electronics fan value.
@Input()
electronicsObj!: electronics;
display1(){
console.log(this.electronics.fan); //This is printing actual value input by user.
}
myConfigurations:ElectronicsInterface = {
fan: this.electronics.fan, //this is giving TypeError
light: this.electronics.light
}
}