Thursday, March 15, 2018

I finally have learned how to make an else work with an *ngIf in Angular 4.

It turns out that it involes a template. This eluded me for some time.

Status:
<ol>
   <li>awake</li>
   <li *ngIf="isWithPlan else noPlan">ready</li>
   <ng-template #noPlan>
      <li>unsure</li>
   </ng-template>
</ol>

No comments:

Post a Comment