Fill user page with avatar, display name and matrix id

This commit is contained in:
Emmanuel ROHEE 2014-08-19 09:37:10 +02:00
parent 38f5c1c378
commit d7a4f2ed7f
3 changed files with 44 additions and 5 deletions

View file

@ -17,9 +17,22 @@ limitations under the License.
'use strict';
angular.module('UserController', ['matrixService'])
.controller('UserController', ['$scope', '$routeParams',
function($scope, $routeParams) {
.controller('UserController', ['$scope', '$routeParams', 'matrixService',
function($scope, $routeParams, matrixService) {
$scope.user = {
id: $routeParams.user_matrix_id
id: $routeParams.user_matrix_id,
displayname: "",
avatar_url: undefined
};
matrixService.getDisplayName($scope.user.id).then(
function(response) {
$scope.user.displayname = response.data.displayname;
}
);
matrixService.getProfilePictureUrl($scope.user.id).then(
function(response) {
$scope.user.avatar_url = response.data.avatar_url;
}
);
}]);