Advertisement
Guest User

Untitled

a guest
Feb 22nd, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. @Component({
  2. selector: "expenses-component",
  3. templateUrl: "expenses.html"
  4. })
  5. export default class ExpensesComponent {
  6. private expenses: [] = [{name: "Foo", amount: 100}, {name: "Bar", amount: 200}];
  7. private totalAmount: number = 0;
  8. }
  9.  
  10. <h2 class="sub-header">Total: {{total | currency:"USD":true}}</h2>
  11. <div class="table-responsive">
  12. <table class="table table-hover table-condensed">
  13. <thead>
  14. <tr>
  15. <th>#</th>
  16. <th>Name</th>
  17. <th>Amount</th>
  18. </tr>
  19. </thead>
  20. <tbody>
  21. <tr *ngFor="let expense of expenses | orderByDate; let id = index">
  22. <td>{{id + 1}}</td>
  23. <td>{{expense.name}}</td>
  24. <td>{{expense.amount | currency:"USD":true}}</td>
  25. </tr>
  26. </tbody>
  27. </table>
  28. </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement