Problems parsing a JSON response using AngularJS

后端 未结 2 979
半阙折子戏
半阙折子戏 2020-12-19 12:23

I am new using AngularJS and I am having an issue parsing a json response. This is the HTML code I am using:





        
相关标签:
2条回答
  • 2020-12-19 12:41

    $http.get will parse the json for you. You do not need to parse it yourself.

       $scope.cars = data.allCars;
    
    0 讨论(0)
  • 2020-12-19 12:43

    Just parse your data like that

    function (response,httpStatus) {    
                     alert('response' + angular.toJson(response));                  
             }
    

    It is built-in feature of angularjs.

    0 讨论(0)
提交回复
热议问题