fixed controllers;
This commit is contained in:
parent
9788e73afb
commit
b27ba889ba
|
@ -33,7 +33,9 @@ app.config(['$stateProvider', '$urlRouterProvider', 'localStorageServiceProvider
|
||||||
templateUrl: '/templates/home.html'
|
templateUrl: '/templates/home.html'
|
||||||
},
|
},
|
||||||
'notifications': {
|
'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');
|
$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
|
||||||
}();
|
}();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
}]);
|
}]);
|
||||||
|
|
|
@ -5,7 +5,7 @@ app.factory('Auth', ['localStorageService', '$location', function(localStorageSe
|
||||||
setUser: function(currentUser){
|
setUser: function(currentUser){
|
||||||
user = 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') {
|
if (redirectedURL === '/splash-page') {
|
||||||
$location.path('/launchpad-home');
|
$location.path('/launchpad-home');
|
||||||
|
@ -16,6 +16,10 @@ app.factory('Auth', ['localStorageService', '$location', function(localStorageSe
|
||||||
isLoggedIn: function(){
|
isLoggedIn: function(){
|
||||||
user = JSON.parse(localStorageService.get('userAuth'));
|
user = JSON.parse(localStorageService.get('userAuth'));
|
||||||
return (user) ? user : false;
|
return (user) ? user : false;
|
||||||
|
},
|
||||||
|
getProfile: function(profile) {
|
||||||
|
profile = user;
|
||||||
|
return profile;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}]);
|
}]);
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
</form>
|
</form>
|
||||||
<ul class="nav navbar-nav navbar-right">
|
<ul class="nav navbar-nav navbar-right">
|
||||||
<li class="dropdown">
|
<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">
|
<ul class="dropdown-menu">
|
||||||
<li><a href="feed.html" target="_blank">Preview My Public Site</a></li>
|
<li><a href="feed.html" target="_blank">Preview My Public Site</a></li>
|
||||||
<li><a>Account Settings</a></li>
|
<li><a>Account Settings</a></li>
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
<div class="alert alert-success" role="alert">
|
<div class="alert alert-success" role="alert">
|
||||||
|
<span class="">
|
||||||
<i class="fa fa-check"></i>
|
<i class="fa fa-check"></i>
|
||||||
<span class="sr-only">Congrats:</span>
|
Welcome: {{ vm.userName() }}
|
||||||
Cool Story Bro...
|
</span>
|
||||||
|
<span class="pull-right">
|
||||||
|
<i class="fa fa-times"></i>
|
||||||
|
</span>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue