Add a user service and load the user information dynamically from the backend.
This commit is contained in:
parent
ccc6e3bd2e
commit
2f98c95d21
4 changed files with 49 additions and 4 deletions
|
@ -1,3 +1,9 @@
|
|||
function HeaderCtrl($scope, UserService) {
|
||||
$scope.$watch( function () { return UserService.currentUser(); }, function (currentUser) {
|
||||
$scope.user = currentUser;
|
||||
}, true);
|
||||
}
|
||||
|
||||
function RepoListCtrl($scope, Restangular) {
|
||||
var repositoryFetch = Restangular.all('repository/');
|
||||
repositoryFetch.getList().then(function(resp) {
|
||||
|
@ -37,4 +43,4 @@ function RepoCtrl($scope, Restangular, $routeParams, $rootScope) {
|
|||
$scope.repo = null;
|
||||
$rootScope.title = 'Unknown Repository';
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue