
<div class="form-display">
  <div  *ngIf="user" id="disp">
<h2 class="page-header">Transaction Details</h2>
<form (submit)="addTransaction(user)">
   <div class="form-group">
     <label> First Name: </label>
     <input type="text" ng-model="first_name" name="first_name" class="form-control" value={{user.first_name}} disabled>
   </div>
  <div class="form-group">
    <label> Last Name:</label>
    <input type="text" ng-model="last_name" name="last_name" class="form-control" value={{user.last_name}} disabled >
  </div>
  <div class="form-group">
    <label> Amount:</label>
    <input type="number" [(ngModel)]="amount" name="amount" class="form-control" >
  </div>
  <div class="form-group">
    <label> Nature:</label>
    <input type="text" [(ngModel)]="nature" name="nature" class="form-control" >
  </div>
  <div class="form-group">
    <label> Category:</label>
    <input type="text" [(ngModel)]="category" name="category" class="form-control" >
  </div>
  <div class="form-group">
    <label> Date:</label>
    <input type="date" [(ngModel)]="date" name="date" class="form-control" >
  </div>
  <div class="form-group">
    <label> Account Number:</label>
    <input type="number" [(ngModel)]="acc_no" name="note" class="form-control" >
  </div>
  <input type="submit" class="btn btn-primary"  id="submit_button" value="Submit">
  <input type="button" class="btn btn-info" id="update_button" (click)="update(user)" value="Update" >
</form>
</div>
<hr>
<div class="row">
 <div class="container">
   <div *ngFor="let t of transactions">
     <div class = "col-md-2">
       &#8377;{{t.amount}}
     </div>
     <div class = "col-md-2">
       {{t.nature}}
     </div>
     <div class = "col-md-2">
       {{t.category}}
     </div>
     <div class = "col-md-2">
       {{t.date}}
     </div>
     <div class = "col-md-2">
       {{t.acc_no}}
     </div>
     <div class ="col-md-2">
       <input type= "button"  value="Delete" (click) = "deleteTransaction(t._id)" value="Delete" class="btn btn-danger">
     </div>
     <div class="col-md-2">
       <button class="btn btn-warning" (click) = "editTransaction(t._id)" >Edit</button>
     </div>
     <br><br>
   </div>

 </div>

</div>
</div>
