本文共 1553 字,大约阅读时间需要 5 分钟。
html代码:
modal代码: /myModalContent.html新增设备信息
js代码: app.controller('xxxCtrl',[ '$scope', '$http', 'deviceService', '$modal', '$log', '$filter', function($scope,$http, deviceService,$modal,$log,$filter){ $scope.open = function() { var modalInstance = $modal.open({ templateUrl : 'assets/myModalContent.html', controller : ModalInstanceCtrl }); modalInstance.opened.then(function() {// 模态窗口打开之后执行的函数 console.log('modal is opened'); }); modalInstance.result.then(function(result) { console.log(result); }, function(reason) { console.log(reason);// 点击空白区域,总会输出backdrop // click,点击取消,则会暑促cancel $log.info('Modal dismissed at: ' + new Date()); }); }; var ModalInstanceCtrl = function($scope, $modalInstance) { /* $scope.items = items; $scope.selected = { item : $scope.items[0] };*/ $scope.ok = function() { $modalInstance.close($scope.selected); }; $scope.cancel = function() { $modalInstance.dismiss('cancel'); }; };
转载地址:http://uviti.baihongyu.com/