You can use EventEmitter and Input, Output in angular for components relations.
like this:
checkbox-component.html
<checkbox (change)="changeEvent()"></checkbox>
checkbox-component.ts
@Output checkboxChange: Eventemitter<boolean> = new Eventemitter<boolean>();
changeEvent(){
// if checbox checked value is true else false
this.checkboxChange.emit(value);
}
parent-component.html
<textbox-component [ShowValue]="checkBoxValue"></textbox-component>
<checkbox-component (checkboxChange)="onCheckboxChange($event)"></checkbox-component>
parent-component.ts
onCheckboxChange(value){
this.checkBoxValue = value;
}
textbox-component.ts
@Input() public set ShowValue(value: boolean)
{
this.show = value;
}
textbox-component.html
<textbox *ngIf="show"></textbox>
the parent component is your web page that contains your independent components.