angular.module("simpleModalPop").controller("applicationListCtrl", [ "$scope", "masterService", "$rootScope", "Notification", "applicationService", "Constant", "$filter", "$state","$uibModal",
function($scope, masterService, $rootScope, Notification, applicationService, Constant,$filter,$state, $uibModal) {
console.log("applicationListCtrl....--->");
$scope.modalInstanceObj = {};
$scope.openModal = function(selected) {
if($scope.currentObj.coApplicantUserId == 5){
var modalInstance = $uibModal.open({
ariaLabelledBy : 'modal-title',
ariaDescribedBy : 'modal-body',
templateUrl : 'application/coApplicantProfile.html',
controller : 'profCtrl',
controllerAs : '$ctrl',
size : 'lg',
resolve : {
}
});
modalInstance.result.then(function(){
console.log("Modal is dimissed !");
},
function(res){
$scope.currentObj.coApplicantUserId={};
});
$scope.modalInstanceObj = modalInstance;
}
}
} ]);
angular.module("simpleModalPop").controller("profCtrl", function($scope, userService) {
$scope.initUserObj();
$scope.createNewCoApplicant = function(){
console.log("createNewCoApplicant");
userService.creatCoApplicantProfile().then(
function(success) {
$scope.isDisable = false;
if(success.data.status == 200){
$scope.modalInstanceObj.close('closed');
}else{
console.log(success.data.message);
}
}, function(error) {
$scope.isDisable = false;
$scope.modalInstanceObj.close('closed');
});
}
});
Выше находится мой js-файл, и я пытаюсь закрыть всплывающее модальное окно после отправки формы. но это дает мне ошибку
"Ошибка типа: невозможно прочитать свойство 'close' из неопределенного"
Я уже ввел ['ui.bootstrap']
в другой файл js. Я использую angularjs V 1.7.x