In my project, I am utilizing https://github.com/simpulton/angularjs-wizard and have made some modifications to it (specifically changed var app
to $scope
). It is functioning well, however, I am facing an issue where I need to pass a variable to the open
function:
$scope.open = function (image)
{
$scope.image = image;
var modalInstance = $uibModal.open({
templateUrl: 'wizard.html',
controllerAs: 'modal',
size: 'lg',
controller: 'ModalCtrl',
resolve: {
image: function () {
return image;
}
}
});
modalInstance.result
.then(function (data) {
$scope.closeAlert();
$scope.summary = data;
}, function (reason) {
$scope.reason = reason;
});
};
and in the HTML:
ng-click="open(image)"
However, the image
variable is showing as undefined
in my template.
The modal window works if I use the example from https://angular-ui.github.io/bootstrap/#/modal, but not with this wizard example.
Update:
Link: https://jsfiddle.net/Ginstay/znz64sk3/2/
Ajax request is completed when opening the modal window.
If I add a breakpoint at return image;
, the image value is present.