Why I can't get my value through of one function? I'm doing rest requests for tests so you can get a date only and always tells me value undefined.
Example
$http.get('app/components/home/controller/test_calendar.json').then(function(value) {
    $scope.example2 = value.data.data[0];
    //console.log($scope.example2);
});
$scope.setDayContent = function(date, content) {
    console.log($scope.example2);
}; 
I get a value undefined with $scope.example2 or other value.
With my first console the data appear well
 
     
     
    