In this code I call the api.The requirement is to take the data from 3 api and aggregate all of them and display in table.
var app = angular.module('myApp', []);
app.controller('PersonController', function($scope,$http) {
$scope.arr1 =[];
$scope.arr2 = [];
$scope.arr3 = [];
$scope.temp ;
function fetchAllBillable(){
var me =$scope;
$http.get("http://echo.jsontest.com/insert-key-here/insert-value-here/key/value")
.then(function(response) {
$scope.temp = response.data;
console.log(me.temp);
});
return $scope.temp;
the value of scope.temp is undefined