fixed controllers;
This commit is contained in:
		
							parent
							
								
									9788e73afb
								
							
						
					
					
						commit
						b27ba889ba
					
				| @ -33,7 +33,9 @@ app.config(['$stateProvider', '$urlRouterProvider', 'localStorageServiceProvider | ||||
|         templateUrl: '/templates/home.html' | ||||
|       }, | ||||
|       'notifications': { | ||||
|         templateUrl: '/templates/partials/notifications.html' | ||||
|         templateUrl: '/templates/partials/notifications.html', | ||||
|         controller: 'HomeController', | ||||
|         controllerAs: 'vm' | ||||
|       } | ||||
|     }, | ||||
|   }) | ||||
|  | ||||
| @ -6,11 +6,13 @@ app.controller('HomeController', ['$scope', 'Auth', 'localStorageService', '$loc | ||||
|     $location.path('/splash-page'); | ||||
|   }; | ||||
| 
 | ||||
|   function userAuth() { | ||||
|     return JSON.parse(localStorageService.get('userAuth')); | ||||
|   } | ||||
| 
 | ||||
|   vm.userName = function(profile){ | ||||
|     profile = Auth.getProfile(); | ||||
|     return profile.email; | ||||
|   }; | ||||
| 
 | ||||
|   console.log('worked:', vm.userName()); | ||||
| 
 | ||||
| 
 | ||||
| }]); | ||||
|  | ||||
| @ -11,5 +11,4 @@ app.controller('SignInController', ['$scope', 'Auth', '$location', 'localStorage | ||||
|     }(); | ||||
|   }; | ||||
| 
 | ||||
| 
 | ||||
| }]); | ||||
|  | ||||
| @ -2,10 +2,10 @@ app.factory('Auth', ['localStorageService', '$location', function(localStorageSe | ||||
|   var user; | ||||
| 
 | ||||
|   return{ | ||||
|     setUser : function(currentUser){ | ||||
|     setUser: function(currentUser){ | ||||
|       user = currentUser; | ||||
| 
 | ||||
|       console.log("%c" + redirectedURL, "color: red; font-size: 72px;"); | ||||
|       // console.log("%c" + redirectedURL, "color: red; font-size: 72px;");
 | ||||
| 
 | ||||
|       if (redirectedURL === '/splash-page') { | ||||
|         $location.path('/launchpad-home'); | ||||
| @ -13,9 +13,13 @@ app.factory('Auth', ['localStorageService', '$location', function(localStorageSe | ||||
|         $location.path('/launchpad-' + redirectedURL); | ||||
|       } | ||||
|     }, | ||||
|     isLoggedIn : function(){ | ||||
|     isLoggedIn: function(){ | ||||
|       user = JSON.parse(localStorageService.get('userAuth')); | ||||
|       return (user) ? user : false; | ||||
|     }, | ||||
|     getProfile: function(profile) { | ||||
|       profile = user; | ||||
|       return profile; | ||||
|     } | ||||
|   }; | ||||
| }]); | ||||
|  | ||||
| @ -19,7 +19,7 @@ | ||||
|       </form> | ||||
|       <ul class="nav navbar-nav navbar-right"> | ||||
|         <li class="dropdown"> | ||||
|           <a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{{ vm.message }} <i class="fa fa-user" aria-hidden="true"></i> <span class="caret"></span></a> | ||||
|           <a class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">{{ vm.userName() }} <i class="fa fa-user" aria-hidden="true"></i> <span class="caret"></span></a> | ||||
|           <ul class="dropdown-menu"> | ||||
|             <li><a href="feed.html" target="_blank">Preview My Public Site</a></li> | ||||
|             <li><a>Account Settings</a></li> | ||||
|  | ||||
| @ -1,5 +1,10 @@ | ||||
| <div class="alert alert-success" role="alert"> | ||||
|   <span class=""> | ||||
|     <i class="fa fa-check"></i> | ||||
|   <span class="sr-only">Congrats:</span> | ||||
|   Cool Story Bro... | ||||
|     Welcome: {{ vm.userName() }} | ||||
|   </span> | ||||
|   <span class="pull-right"> | ||||
|     <i class="fa fa-times"></i> | ||||
|   </span> | ||||
| 
 | ||||
| </div> | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user