我正在尝试使用 UI Bootstrap 模态,而不是常规的 Bootsrap 模态。我在父控制器中有一个 $scope.DoIt = function() ,但是当我尝试从模态调用它时,什么也没有发生。
我究竟做错了什么?
如何访问父控制器中的功能?
这是我打开模式的方式:
applyConfirm: function() {
if(self.showingExpenses !== true) {
self.showingExpenses = true;
var modalInstance = $modal.open({
animation: true,
templateUrl: 'applyConfirm.html',
controller: function($scope, $modalInstance, expenses, jobsService, job) { //'ModalInstanceCtrl',
angular.extend($scope, {
expenses: expenses,
job: job
});
$scope.close = function() {
//self.showingExpenses = false;
$modalInstance.close();
};
}
}