I have two different responses, one there we need to loop over the object to show the right response. And the other one we just show the variable.
What I have tried is an ng-if else
but it is not working.
it is about this piece of code:
<div *ngFor="let courseTimeslot of course?.timeslots">
<div *ngIf="courseTimeslot; else timeslot" class="timeslots s-padding-l">
{{ courseTimeslot.timeslot }}
</div>
</div>
<ng-template #timeslot *ngIf="course?.timeslots" class="timeslots s-padding-l">{{ course?.timeslots }}</ng-template>
Is this the right way to do otherwise I would like to hear any other options.