$scope.fetchQA = function() {
$scope.url = 'js/jsons/QA.json';
$http({method: 'GET', url: $scope.url}).
success(function(data, status, headers, config) {
$scope.QA = data;
});
}
$scope.fetchQA();
function x(){
alert(QA);
}
How do i use function x as a callback for $http.get? or is there any other way to ensure that x() will get executed only after reception of data in fetchQA?