So far I have used many times $rootScope and I had no bigger problems. Now it is a problem where i need to set $http.get to $rootScope. I always get undefined Here is ctrl
$http.get(serviceBase + 'aaaa/aaaa/' + $stateParams.klupaID)
.success(function (data) {
$rootScope.klupaCreatedAt = data.created_at;
});
Also i try make factory, but i have same problem.
$scope.currentKlupa = sveKlupeServiceFactory.get({klupa: $stateParams.klupaID});
$scope.currentKlupa.$promise.then(function (data) {
$rootScope.klupaCreatedAt = data.created_at;
})
Can someone help me, how to set on $rootScope my response data. I try solution from here Why I can't set/get $rootScope? and from here Cannot get to $rootScope but without success Thnx
EDIT: here is plunker link https://plnkr.co/edit/GOq1MT7eqxBDMtkuYVvr?p=preview