방금 Angular를 배우기 시작했고 이제는 JSON에서 가져온 일부 레코드를 보여주는 웹 응용 프로그램을 사용 중입니다. 내가이 길에 그 구문 분석하고AngularJS parse JSON
"results": [
{
"easy": false,
"id": 1,
"title": "title",
}
]
이에 (그래서 지금 내가 ID를 얻을 필요가이 JSON 파일에서 오전
var app = angular.module("DB", []);
app.controller("Controller", function($scope, $http) {
$http.defaults.headers.common["Accept"] = "application/json";
$http.get('api_url').
success(function(data, status, headers, config) {
$scope.thing = data.results;
});
});
을 (나에게 올바른 것) 같은 JSON 본다 경우 1) 그 ID와 함께 첫 번째 파일에서 결과에 대한 자세한 정보를 얻으려면 api.com/game/{id}
새로운 요청을해야합니다.
가장 좋은 방법은 무엇입니까?
않습니다. – MohamedAbbas