I made resource that receive records count from rest service as text plain. Angular makes an array of each chars from answer. For example if rest answers 20
, angular will make array [2,0]
. Can I fix it without transforming response or using $http
?
var resource = angular.module('resource');
resource.factory('RecordResource', ['$resource',
function($resource) {
return $resource('/rest/records/:id', {}, {
count: {
method:'GET',
url: "/rest/records/count",
isArray: false,
responseType: 'text'
}
}
}
]);
defaultHttpResponseTransform
that would turn your string into an array. You'll need to show your code where you call the resource method and handle the response – Alessandraalessandria