I have this button which fires the removefromselected()
function when pressed. It does not confirm before firing. How can i add a box or popup which will ask the user to confirm his action. And if the user presses confirm only then the removefromselected()
function will fire. How can i do that? Below is my code -
html-
<div class="col-md-6">
<h4>Reserved Seats</h4>
You have selected the following dates for {{selectedTrip.from}} to {{selectedTrip.to}}
<ul class="booked">
<li ng-repeat='d in selectedDates | orderBy : app.identity | futureDate'>
{{d | date : 'fullDate'}} {{selectedTrip.arrivalTime}}
<button class='btn btn-xs btn-warning btn-skinny' style='margin:5px' ng-click='removeFromSelected(d)'>Remove</button>
</li>
</ul>
</div>
the function-
$scope.removeFromSelected = function(dt) {
if ($scope.selectedDatesMap[dt]) {
$scope.selectedDatesMap[dt].keep = false;
}
$scope.selectedDates.splice($scope.selectedDates.indexOf(dt), 1);
$scope.setDateSelected(new Date(dt), false);
};