角度js对话框弹出窗口

时间:2016-11-03 15:02:18

标签: javascript angularjs html5

<td>
    <input type="checkbox" class="checkBox" 
        ng-model="alert.acknowledged" 
        ng-disabled="alert.acknowledged" 
        ng-click="onacknowledgedClick(alert)">
</td>

我有一个确认列的复选框,当用户点击复选框时,它会弹出一个对话框,询问您是否要通过电话,短信或电子邮件进行确认?

有人可以帮我解决Angular JS概念吗?我是新手。

1 个答案:

答案 0 :(得分:1)

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);
 };
});

完整的解决方案 - https://plnkr.co/edit/VnAv67AMrykf6CEyrAiv?p=preview