I\'m having a problem with $uibModal\'s open function, specifically injecting my parameters properly into an inline controller function.
Being the angularjs noob that I
In-case anybody ends up here trying to figure out how to inject parameters into an inline controller, what ultimately worked is my final attempt using the extended syntax with the changes from the first update.
var modalInstance = $uibModal.open({
animation: false,
templateUrl: 'app/workform/LoanActions/LoanActionOverpay.modal.html',
controller: ['$scope', '$uibModalInstance', 'loanKeyFactory', 'loanFactory', function ($scope, $uibModalInstance, loanKeyFactory, loanFactory) {
$scope.showOverpay = true;
$scope.OverpayAccount = function () {
$scope.loading = true;
var key = loanKeyFactory.getLoanKey();
loanFactory.getLoanInformation(key).then(function (response) {
$scope.loanType = response.LoanType;
$uibModalInstance.dismiss('cancel');
if ($scope.loanType == 'LineOfCredit')
ChooseLocLoanStatus();
else
CreatePayment(true, null);
});
};
$scope.cancel = function () {
$uibModalInstance.dismiss('cancel');
ClearForm();
}
}],
size: 'md',
backdrop: 'static',
keyboard: false
})