Fix JSON serialization relying on response content

Signed-off-by: Javier Revillas <jrevillas@massivedynamic.io>
This commit is contained in:
Javier Revillas 2017-11-18 10:50:23 +01:00 committed by Alex Ellis
parent 6390f66e3e
commit 86c83f0dcd

View File

@ -59,8 +59,8 @@ app.controller("home", ['$scope', '$log', '$http', '$location', '$timeout', '$md
$http(options)
.then(function(response) {
if ($scope.invocation && $scope.invocation.contentType == "json") {
$scope.invocationResponse = JSON.stringify(response.data, -1, " ");
if (typeof response.data == 'object') {
$scope.invocationResponse = JSON.stringify(response.data, null, 2);
} else {
$scope.invocationResponse = response.data;
}
@ -205,4 +205,4 @@ app.controller("home", ['$scope', '$log', '$http', '$location', '$timeout', '$md
fetch();
}
]);
]);