I have main controller:
.controller('mainCtrl', ['$scope', '$rootScope', 'Data', '$http', '$log', '$filter', '$q', '$timeout', function($scope, $rootScope, Data, $http, $log, $filter, $q, $timeout){
Data.get('customers').then(function(data){
$scope.customers = data.data;
$rootScope.language = data.data[0].language;
});
$rootScope.word_pub_curr_lang = 'word_pub_' + $rootScope.language;
console.log('from maincrtl', $rootScope.word_pub_curr_lang);
}]);
The problem is that I can't receive $rootScope.word_pub_curr_lang or $rootScope.language - are always undefined.