Rajesh k bhushan Ответов: 0

Сумма всех первых столбцов всех строк отображается в текстовом поле в angular


Я хочу, чтобы сумма первого столбца суммы и эта сумма суммы отображались в текстовом поле debit total с помощью angular.

I did not any idea about how to get particular cell of value and sum it that's why i cannot written code of angular


Что я уже пробовал:

<html>
<div class="sized">
  <table align="right" class="table table-striped table-bordered">
      <thead>
          <tr>
              <th>#</th>
              <th>Amount</th>
              <th>Discription</th>
              <th>Action</th>
          </tr>
      </thead>
      <tbody>
          <!-- <tr> -->
           <tr *ngFor="let notification of notificationArray; let i = index">
              <td>{{i+1}}</td>
              
              <td>
                  <input [(ngModel)]="notification.notificationLevel" placeholder="only numeric value" onkeypress='return event.charCode >= 48 && event.charCode <= 57' required class="form-control" type="text" name="amount" />
              </td>
              <td>
                  <input [(ngModel)]="notification.message" required class="form-control" type="text" name="description" />
              </td>
              <td>
                  <button class="btn btn-danger"  type="button" (click)="deleteNotification(i)">Delete</button>
              </td>
          </tr>
      </tbody>    
  </table>
</div>


</div>
            <div class="float-right">
                <label>Debit Total:</label>
                <input type="text" name="debittotal" class="form-control">
            </div>  
        </div>
</html>

Rajesh k bhushan

Я не имел ни малейшего представления о том, как получить конкретную ячейку значения и суммировать ее, поэтому я не могу написать код angular

0 Ответов