Thank you, i did look at that but doesn't fulfill my requirement. I didnt think I would get stuck at something as simple as this but here I am. Isnt there any way I can have more than one statement when a if condition evaluates to true or false?
I presume you're looking for ngSwitch
Refer https://angular.io/api/common/NgSwitch
Update:
After deep thought, I hope, I am finally able to figure out what you are asking for...
<ng-container *ngIf="col !='actions'; else multilpleActions">
...
</ng-container>
<ng-template #multilpleActions>
<ng-container *ngTemplateOutlet="showAction"></ng-container>
<ng-container *ngTemplateOutlet="anotherAction"></ng-container>
</ng-template>
<ng-template #showAction>
...
</ng-template>
<ng-template #anotherAction>
...
</ng-template>
I really hope this helps.
UPDATE (After your edit)
Let me point out, *ngIf
does not work on statements of code which work sequentially, but on HTML templates which are just text. *ngIf
does a boolean operation on a single element and lets you select from 2 templates which one to be rendered into it. At any given time you can only render one template to one element. So what you are asking for is impossible. If you need to render more than one template to one element, only way out is to have them as children of a parent and render the parent to the element.
Happy Coding!