I am trying to make a statefull modal using angular ui route and and angular ui modal.
lets say i want to fill a sign up form which consist of 4 pages. All of these pages are in a modal.
I am able to open modal on state change. But after that i want to open each pages of the modal on the bases of state.
$stateProvider.state('signup', {
url: '/signup',
template: '<ui-view />',
abstract: true
})
.state('signup.modal', {
url: '',
resolve: {
modalInstance: function($modal) {
return $modal.open({
template: '<div ui-view="modal"></div>',
controller: 'signUp',
windowClass: 'signup-edit-modal',
backdrop: 'static'
})
}
},
onEnter: ['modalInstance', '$timeout', '$state',function(modalInstance,$timeout, $state) {
modalInstance.opened.then(function(status){
if(status){
$timeout(function(){
// changing color of background / backdrop of modal for signup
angular.element('.reveal-modal-bg').css('backgroundColor','rgba(255, 255, 255, .9)');
})
}
})
$state.go('signup.welcome')
}],
onExit: function(modalInstance) {
modalInstance.close('dismiss');
angular.element('.reveal-modal-bg').css('backgroundColor','rgba(0, 0, 0, 0.45)');
}
})
.state('signup.welcome', {
url: "/welcome",
views: {
modal: {
templateUrl: 'main/signup/welcome.html',
controller: 'signupWelcome'
}
}
}).state('signup.step1', {
url: "/step1",
views: {
modal: {
templateUrl: 'main/signup/step1.html',
controller: 'signupStep1'
}
}
})
the above code able to open the modal and it also change the state to welcome but for some reason the template is not loading inside the modal.
i have assign the template to a ui-view=modal
it should open but not.
please help me. thanks in advance