child.component.ts
//ignoring all imports
@component({
selector: 'app-child',
template: './child.component.html'
})
import class ChildComponent {
//logic not of use
public isData: boolean = false;
}
child.component.html
<input type="text" value="xyz" [readonly]="isData">
parent.component.ts
//ignoring all imports
parent.component.html
<app-child></app-child>
Here, I wanted to use the child component inside parent but I don't want the input field readonly, rather changing it inside child I want to change it inside parent so that my child component should not gets disturbed.
How would I achieve it?