Reputation: 25
<td>
<input type="checkbox" class="checkBox"
ng-model="alert.acknowledged"
ng-disabled="alert.acknowledged"
ng-click="onacknowledgedClick(alert)">
</td>
I have a checkbox for acknowledged column, when the user clicks on the checkbox, it has display a dialog pop up asking for do you want to acknowledge through phone, text or email?
Can someone help me with the Angular JS concept? I am new to this.
Upvotes: 1
Views: 94
Reputation: 349
angular.module('app','ngAnimate','ui.bootstrap']).controller("Hello",function($scope,$modal){
$scope.selectedAckOption ="NONE";
$scope.onacknowledgedClick=function(al) {
var modalInstance = $modal.open({
templateUrl: 'stackedModal.html',
controller: 'ModalInstanceCtrl',
size:'md',
resolve: {}
});
modalInstance.result.then(function (selectedItem) {
$scope.selectedAckOption = selectedItem;
}, function () {
console.log('Modal dismissed at: ' + new Date());
});
};
}).controller("ModalInstanceCtrl",function($scope,$modalInstance){
$scope.saveOption = function() {
$modalInstance.close($scope.ackOption);
};
});
Complete solution - https://plnkr.co/edit/VnAv67AMrykf6CEyrAiv?p=preview
Upvotes: 1