我正在尝试使用第二个模态弹出窗口来确认关闭当前模态。它使用模式调用$ scope.closeConfirm的按钮工作正常,但我试图覆盖$ modalInstance.dismiss也调用$ scope.closeConfirm但似乎无法让它工作。任何帮助表示赞赏。
'use strict'
angular.module("app").controller "ModalCtrl", ['$scope', '$rootScope', '$state', '$modalInstance', '$modal', ($scope, $rootScope, $state, $modalInstance, $modal)->
$modalInstance.dismiss = $scope.closeConfirm()
$scope.close = ->
$modalInstance.close(true)
$scope.closeConfirm = (newcase) ->
_scope = $scope
modalInstance = $modal.open(
animation: true
templateUrl: '/views/confirm.html'
controller: 'ConfirmCtrl'
size: 'sm')
modalInstance.result.then ((response) ->
_scope.close()
return
), ->
return
return
]