角度弹出不是第二次开放

时间:2014-11-15 08:59:25

标签: javascript angularjs

嗨我正在尝试一个接一个地打开两个弹出,但第二个弹出没有第二次打开。

$scope.items = ['item1', 'item2', 'item3'];

  $scope.open = function (size) {

    var modalInstance = $modal.open({
      templateUrl: 'templates/main/device_deregister.html',
      controller: ModalDeleteDeviceCtrl,
      size: size,
      resolve: {
        items: function () {
          return $scope.items;
        }
      }
    });

    modalInstance.result.then(function (selectedItem) {
      $scope.selected = selectedItem;
    }, function () {
      $log.info('Modal dismissed at: ' + new Date());
    });
  };



$rootScope.successOpen = function (size) {

        var modalInstance = $modal.open({
             templateUrl: 'templates/main/deregister_device_success.html',
              controller: 'ModalDeleteDeviceSuccessCtrl',
          size: size,
          resolve: {
            items: function () {
              return $scope.items;
            }
          }
        });

        modalInstance.result.then(function (selectedItem) {
         // $scope.selected = selectedItem;

        }, function () {
          $log.info('Modal dismissed at: ' + new Date());
        });
      };

打开第二个弹出窗口的代码

$modalInstance.close($scope.selected.item);
$rootScope.successOpen('lg');

关闭第二个弹出窗口的代码

$modalInstance.close($scope.item);

0 个答案:

没有答案