Add a user service and load the user information dynamically from the backend.

This commit is contained in:
yackob03 2013-09-26 19:59:58 -04:00
parent ccc6e3bd2e
commit 2f98c95d21
4 changed files with 49 additions and 4 deletions

View file

@ -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';
});
}
}