使用angularjs模態框$modal
阿新 • • 發佈:2018-12-23
.factory('singleModal', ['$modal', function($modal) { var vm = this; vm.modal = null; vm.draggable = function(){ $(".modal-content").draggable({ handle: ".modal-header", cursor: 'move', refreshPositions: false }); }; return { open: function(param,result_fc,reason_fc) { if (vm.modal != null) { return null; } vm.modal = $modal.open(param); vm.modal.result.then(function(result) { vm.modal = null; if(result_fc!= null){ result_fc(result); } },function(reason){ vm.modal = null; if(reason_fc!= null){ reason_fc(reason); } }); vm.modal.opened.then(function() { setTimeout(vm.draggable,3000); }); return vm.modal; } } }])