I am trying to make statefull modal using angular ui route and angular ui modal.
allows me to fill out a 4-page registration form. All of these pages are modal.
I can open a modal state change. But after that, I want to open every page of the modal based on the 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(){
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 can open modal as well as change state to welcome, but for some reason the template does not load inside the modal. I assigned a template ui-view=modalthat it should open, but not.
Please help me. thanks in advance