11angular . module ( 'madisonApp.controllers' )
22 . controller ( 'SignupPageController' , [ '$scope' , '$state' , 'AuthService' ,
3- 'growl' , 'growlMessages' , '$translate' , 'pageService' , 'SITE' ,
3+ 'growl' , 'growlMessages' , '$translate' , 'pageService' , 'SITE' , '$rootScope' ,
44 function ( $scope , $state , AuthService , growl , growlMessages , $translate ,
5- pageService , SITE ) {
5+ pageService , SITE , $rootScope ) {
66 $translate ( 'content.signup.title' , { title : SITE . name } ) . then ( function ( translation ) {
77 pageService . setTitle ( translation ) ;
88 } ) ;
@@ -15,7 +15,13 @@ angular.module('madisonApp.controllers')
1515 signup . success ( function ( ) {
1616 $scope . credentials = { fname : "" , lname : "" , email : "" , password : "" } ;
1717 AuthService . getUser ( ) ;
18- $state . go ( 'index' ) ;
18+
19+ if ( $rootScope . previousState && $rootScope . previousState . name !== '' ) {
20+ $state . go ( $rootScope . previousState . name , $rootScope . previousState . params ) ;
21+ } else {
22+ $state . go ( 'index' )
23+ }
24+
1925 growl . success ( $translate . instant ( 'form.signup.success' ) ) ;
2026 } )
2127 . error ( function ( response ) {
0 commit comments