My code of controller is : -

```
var app = angular.module('myApp');
app.controller('myCtrl', function() {
    $scope.year = "1350";
    $scope.ord1 = "";
    $scope.s1t1 = function() {
        $http({
            url: 's1t1.json',
            method: 'GET'
        }).then(function(response) {
            $scope.set = response.data;
            //console.log($scope.set);
            $scope.obj = $scope.set.find(o => o.year === $scope.year);
            $scope.ord1 = $scope.obj.ordinal;
        });
    }
    alert($scope.ord1);
});

```

I get a value like 44144 in `$scope.ord1`. and I need to use it in my controller outside `s1t1` function. I represent It with a alert. I am also try it with `$rootScope` but result is same.