我的下一个Web API:REST AngularJS @resource参数化的要求
GET List<EventHistory> '/service/eventhistories'
GET EventHistory '/service/eventhistories/{id}'
DELETE EventHistory '/service/eventhistories/{id}'
PUT EventHistory '/service/eventhistories'
POST EventHistory '/service/eventhistories'
使用的角度,我想用@resource从服务器获取信息。
angularApp.factory('eventHistoryFactory', function ($resource) {
return $resource('/inner/service/eventhistories/:id',{id:'@id'});
});
但是使用这个声明我没有任何API来根据一些数据请求页面。
var pageRequest = {
size: size,
page: page
};
或发送更新eventHistory实体。
我不完全确定我明白。您是否担心分页或您没有后端分页实施的事实? –
我已经回来和分页,但我不能同时发送到具有ID(inRow参数)和可分页数据的后端请求。 我知道,它应该像 eventHistoryFactory.get(pageRequest,功能(数据){ controllerScope.eventHistorySingle =数据; }) 但如何我要补充ID请求,如果我更新的实体? – Sergii
简短的回答是 - 你不。角度为你做。在下面检查我的答案。 –