Quick fix for the above example (i.e. you have only two child components, and your variables are of boolean type) would be reversing values for the variables
<button (click)="Activate_variable1">Activate Variable1</button>
<button (click)="Activate variable2">Activate Variable2</button>
<child-component [variable1]="variable1" [variable2]="variable2"></child-component>
<child-component [variable1]="!variable1" [variable2]="!variable2"></child-component>
Also, you can simplify your code for the child component by removing === comparison if the only possible values for that variable are true and false, i.e.:
<div *ngIf="variable1">
Container 1
</div>
<div *ngIf="variable2">
Container 2
</div>
Does it answer your question?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…