I am requesting three urls in AngularJs by Using JSONP.
For the first time i am getting the values. But after second call i am not getting any value. When i see the console i found this error.
Exception: TypeError: 'caller', 'callee', and 'arguments' properties may not be accessed on strict mode functions or the arguments objects for calls to them
What is this error meant by?
Here is my sample code.
appPortal.controller('HistoCtrl', ['$rootScope', '$scope', '$http', '$location',
function($rootScope, $scope, $http, $location) {
console.log($rootScope);
$scope.url1 = '';
$scope.url2 = '';
$scope.url3 = '';
//request handler
$scope.sendDataRequest = function() {
$http.jsonp($scope.url1).then(function(msg) {
console.log(msg.data);
});
$http.jsonp($scope.url2).then(function(msg) {
console.log(msg.data);
});
$http.jsonp($scope.url3).then(function(msg) {
console.log(msg.data);
});
};
//get current month data
$scope.getCurrentMonthData = function() {
$scope.url1 = $rootScope.ApiWeatherHost + '/climo/v1/actuals/' + $scope.location_key + '?callback=JSON_CALLBACK&start=' + $scope.start + '&end=' + $scope.end + '&apikey=' + $rootScope.ApiKey;
$scope.url2 = $rootScope.ApiWeatherHost + '/climo/v1/records/' + $scope.location_key + '?callback=JSON_CALLBACK&start=' + $scope.start + '&end=' + $scope.end + '&apikey=' + $rootScope.ApiKey;
$scope.url3 = $rootScope.ApiWeatherHost + '/climo/v1/normals/' + $scope.location_key + '?callback=JSON_CALLBACK&start=' + $scope.start + '&end=' + $scope.end + '&apikey=' + $rootScope.ApiKey;
$scope.sendDataRequest();
};
}
]);
I am try to get these rest API Using the Jsonp