I am working on a div element where I need to dynamically add inputs that should form a number with a specific format. To ensure the inputs start from the left, I have applied the justify-content-end
class.
HTML:
<div class='row justify-content-end'>
<ng-container *ngFor='let input of dashAndInputCount; let i = index'>
<button (click)='addDashAndInput(i)'> - </button>
<div class='col-2' style='padding-top: 2.2rem !important;'>
<input type='number'></input>
</div>
<div class='col-1 ax-text-center'>
<p>
ــ
</p>
</div>
</ng-container>
</div>
TS:
addDashAndInput(i) {
this.dashAndInputCount.push(1);
}
However, I encountered an issue where the items are added in the wrong direction. For example, adding 1, 2, 3, 4 results in them displaying as 4, 3, 2, 1. How can I resolve this problem?