Here is my HTML code below.
<div class="row" style="padding-bottom: 5%;">
<div class="col-md-12" id="HolidayDiv">
<div class="form-group row justify-content-md-center m-b-10">
<label class="col-md-4 text-md-right col-form-label">
<div>HOLIDAY NAME</div>
<div><input type="text" name="firstname" placeholder="" class="form-control"></div>
</label>
<label class="col-md-4 text-md-right col-form-label">
<div>HOLIDAY DATE</div>
<div>
<div class="input-group date" data-provide="datepicker">
<input type="text" class="form-control">
<div class="input-group-addon">
<span class="far fa-calendar-alt"></span>
</div>
<i class="fas fa-lg fa-fw m-r-10 m-l-5 m-t-10 text-grey fa-indent"></i>
</div>
</div>
</label>
</div>
</div>
<!-- end #content -->
<!-- end col-10 -->
</div>
Here is screenshot below.
Here the small red box is an add button and the large red box div is what i need to add below dynamically.
Here is my typescript file below.
import { Component, Input, OnInit } from '@angular/core';
@Component({
selector: 'CustomerProfileAdd',
templateUrl: './CustomerProfileAdd.html',
styleUrls: ['./CustomerProfileAdd.css']
})
export class CustomerProfileAdd {
active = 1;
}
As i have several examples but only as https://stackblitz.com/edit/angular-pujraw?file=src%2Fapp%2Fapp.component.css and as like https://stackblitz.com/edit/dynamically-add-rows-gk4veg?file=app%2Fapp.component.html but for division I couldn't find it.
ngForand and and array to do this. When you doarray.push, Angular will ad another element to that list