I think you try to use the modal service in a wrong way, especially how you want to pass through the isRegistrationPage variable.
Take a look at the code snippets below:
Here you can see part of my controller where the editBlogEntry method is responsible for opening the modal window. Note the resolve part where I can pass through variables.
function editBlogEntry(blogEntryId)
{
var modalInstance = $modal.open({
templateUrl: '/ui/app/dilib/partials/blog/blog-entries/blog-entry-form.html',
controller: 'editBlogEntryController as vm',
size: 'lg',
resolve: {
selectedBlogEntryId: function ()
{
return blogEntryId;
}
}
});
modalInstance.result
.then(function (result)
{
logSuccess('Blog entry is modified!');
$route.reload();
});
}
This is part of the controller which will be instantiated when the modal window is opened. Note the selectedBlogEntryId which is the passed through variable.
var controllerId = 'editBlogEntryController';
angular
.module('dilibApp')
.controller(controllerId, ['$scope', '$modalInstance', 'selectedBlogEntryId', 'common', 'datacontext', 'dataservice.blogentry.helper', editBlogEntryController]);
function editBlogEntryController($scope, $modalInstance, selectedBlogEntryId, common, datacontext, dataServiceBlogEntryHelper)
{ /*... javascript magic ...*/}
HTML part, where you can see that the edit method is bound to a button element.
<button class="btn" ng-model="blogEntry.id" ng-click="vm.editBlogEntry(blogEntry.id)">edit</button>
isRegistrationPageis not in in scope but in HTML partisRegistrationPagewithin HTML code, like that:ng-init="isRegistrationPage"and change it later byng-click="isRegistrationPage=falseor so. But when I need to open modal AND changeisRegistrationPagethen it won't work.