Skip to content

Commit

Permalink
Page title update should wait for categories
Browse files Browse the repository at this point in the history
  • Loading branch information
slaweet committed Jan 3, 2016
1 parent 35c8eed commit e6de224
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions anatomy/static/js/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
/* Controllers */
angular.module('proso.anatomy.controllers', [])

.controller('AppCtrl', ['$scope', '$rootScope', 'userService', 'pageTitle', 'configService', 'gettextCatalog', '$location',
function($scope, $rootScope, userService, pageTitle, configService, gettextCatalog, $location) {
.controller('AppCtrl', ['$scope', '$rootScope', 'userService', 'pageTitle', 'configService', 'gettextCatalog', '$location', 'categoryService',
function($scope, $rootScope, userService, pageTitle, configService, gettextCatalog, $location, categoryService) {
'use strict';
$scope.configService = configService;
$scope.userService = userService;
Expand All @@ -14,7 +14,9 @@ angular.module('proso.anatomy.controllers', [])
};

$rootScope.$on("$routeChangeStart", function(event, next) {
categoryService.getAllByType().then(function(){
$rootScope.title = pageTitle(next) + $rootScope.initialTitle;
});
});

$scope.initLanguageCode = function (code) {
Expand Down

0 comments on commit e6de224

Please sign in to comment.