I'm using page variables to add/remove components from my page.
This sounds weird but it actually works.
mypage.html
<pop-product *ngIf="this.pop_product_open" [data]="this.pop_product_data"></pop-product>
mypage.ts
public pop_product_open:boolean = false;
public pop_product_data:any = null;
...
async openPopProduct(product){
this.pop_product_open = true;
this.pop_product_data = product;
}
Is there any other/simplest/better way to add/remove component from the page?
I'm asking cause I'm going to have about 15 components and it's scary how messy the code is going to be on managing lots of variables this way.