function _getTagObject() {
return $http.get('http://localhost:8081/tag?limit=1').then(
function(response) {
response.data[0];
});
};
我试图只返回response.data[0]
。
答案 0 :(得分:1)
你非常接近。您只需要从response.data[0]
成功回调中返回then
:
function _getTagObject() {
return $http.get('http://localhost:8081/tag?limit=1').then(function(response) {
return response.data[0];
});
};