I have used date time picker . It works fine when i use it as static. how to make it works, when i add the input fields dynamically. Html
<div class="form-group" ng-repeat="item in items">
<div class="row" style="margin: 15px 0px;">
<div class="col-md-6 col-lg-6 col-sm-6" style="padding-left:0">
<label>Start Date</label>
<p class="input-group">
<input type="text" class="form-control" datetime-picker="dd/MM/yyyy" enable-time="false" ng-model="item['start_date'+$index]" is-open="['start_date'+$index].open" />
<span class="input-group-btn">
<button type="button" class="btn btn-default" ng-click="openCalendar($event, 'start_date',$index)"><i class="fa fa-calendar"></i></button>
</span>
</p>
</div>
</div>
</div>
<button ng-click="add()">Add New Row</button>
controller
$scope.items = [];
$scope.add = function() {
$scope.items.push({
start_date:"",
});
}
$scope.openCalendar = function(e,picker,index) {
console.log('index',index);
console.log('picker',picker);
var picker_index=picker+index;
console.log($scope[picker_index])
$scope.[picker_index]open = true;
console.log( $scope[picker][index])
};
i am not able to open the particular datepicker using index value from the ng-model and is-open attribute. since the datepickers are adding dynamically. can anyone please help me on this.