dimanche 25 juin 2017

How to use if-else with string in angular2 expression

I wanna to generate html code like below by *ngFor into angular 2 expression.

<ol class="breadcrumb">
  <li><a href="#">Home</a></li>
  <li><a href="#">Library</a></li>
  <li class="active">Data</li>
</ol>

I use this code but it's not true:

<ol class="breadcrumb">
    <li *ngFor="let item of siteMap; let isLast = last" [class.active]="isLast">
        
    </li>
</ol>

What should I do?

Aucun commentaire:

Enregistrer un commentaire