Using many async pipes in single *ngIf means less readable code and it reduces performance because async is a pure pipe.
A better idea is to use RxJs operators to combine multiple conditions into a single observable object. For example, you can use combineLatest operator.
Return null to hide section if conditions are not fulfilled
Using many *ngIf unnecessary increases a template’s size and complexity.
You can check conditions inside component logic, create an observable object and return null if conditions are not fulfilled.
Section won’t be shown because *ngIf only render template when value is truthy. Than means when we return null
section will be hidden.
Do you like the content?
Your support helps me continue my work. Please consider making a donation.
Donations are accepted through PayPal or Stripe. You do not need a account to donate. All major credit cards are
accepted.