0

I am having an issue where the default template is still appearing after an if condition executes. So for example in the following code, the link is being printed in the first if and then also the text without the link in the default template right beside it in the same column. I want the default template to execute most of the time with the exception of the 3 if conditionals.

<div *ngIf=" (something != undefined) ) ; else second">
    <a href="linkhere">{{ row[column] }}</a>
</div>

<div #second *ngIf=" (something2 != undefined) ; else third">
    <a href="mailto:{{ row.email }}" (click)="stopProp($event)"></a>
</div>

<div #third *ngIf=" (somethingelse != undefined); else defaultTemplate">
    <mat-icon color="warn" class="material-icons">clear</mat-icon> 
</div>

<ng-template #defaultTemplate>
    {{ row[column] }}
</ng-template>
Aleksey Solovey
  • 4,153
  • 3
  • 15
  • 34
moe
  • 45
  • 1
  • 9

0 Answers0