This should be closed, because its an async issue... run this code and you will see.
angular.module('myApp').run(function ($rootScope,$http) {
$rootScope.username = 'abc';
var $promise = $http.get('/api/getuser')
.success(function(data) {
console.log("logged in user is: "+data);
$rootScope.username = data;
});
$rootScope.$on('$routeChangeStart', function (event, next) {
});
$promise.then(function(){
console.log("logged in user after setting: "+$rootScope.username);
});