1
xml response to json
をangularjs
に変換する必要があります。私はxml形式で応答を提供するRest APIを使用していますが、$ http.get()を介して取得する際にはangularjsにjson応答が必要です。angularjsを使用してdbからレコードを取得した後にxmlをjsonに変換します
以下は、angularjsにrest APIを使用している方法です。
<script>
var app = angular.module('myApp', []);
app.controller('myCtrl', function($scope,$http) {
$http({
method: 'GET',
url: "https://some-url?fieldList=field1,field2"
}).then(function(response) {
$scope.obj=response.data.records;},function(response){});}
});
</scripts>
xml応答をjsonに変換し、それを変数$ scope.objの入力として提供する方法は?ここで