Advertisement
irobust

SPA Product List

Jun 14th, 2018
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.78 KB | None | 0 0
  1. <table class="table">
  2.   <thead>
  3.     <tr>
  4.       <th>#</th>
  5.       <th>Code</th>
  6.       <th>Name</th>
  7.       <th>Price</th>
  8.       <th>Level</th>
  9.     </tr>
  10.   </thead>
  11.   <tbody>
  12.     <tr *ngFor="let product of products, let i = index">
  13.       <td>{{ i+1 }}</td>
  14.       <td>{{ product.productId | code:'5' }}</td>
  15.       <td>{{ product.productName | lowercase | uppercase }}</td>
  16.       <td>
  17.           <span class="price"
  18.            [ngClass]="{'low-price': product.price<20}">
  19.             {{ product.price | number:'2.2-2' }}
  20.           </span>
  21.       </td>
  22.       <td>
  23.           <span *ngIf="product.price<20; else high">
  24.             LOW
  25.           </span>
  26.           <ng-template #high>
  27.           <span>HIGH</span>
  28.           </ng-template>
  29.       </td>
  30.     </tr>
  31.   </tbody>
  32. </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement