locked
Problem with Angulrjs Function $http.get() RRS feed

  • Question

  • Here is the code i am using but i dont get any data from it, tell me if i am doing wrong approach..

    $scope.get_result = function (){
            $http.get('accuData/Islamabad_accuData.php').then( function successCallback(data){
                $scope.islamabadaccu = data;
                var ar = new Array();
                
                alert("Islamabad Dates = "+$scope.islamabadaccu[1]);
                 for(var i=0;i<5;i++){
                     ar.push(data[i]);
                    alert("Data = "+ar[i]);
                }
            
            },function errorCallback(data){
                    console.log("Error with data ");                     
                         });
        }

    Sunday, December 27, 2015 6:34 PM