Package org.angular.ts.ng
Interface RestService<T,ID>
@JsType(isNative=true,
name="ng.RestService",
namespace="<global>")
public interface RestService<T,ID>
Public AngularTS RestService contract exposed through the global ng namespace for Closure-annotated applications.
-
Method Summary
Modifier and TypeMethodDescriptionelemental2.promise.Promise<T> Create a resource using `POST`.elemental2.promise.Promise<Void> Delete a resource by ID.elemental2.promise.Promise<T> Fetch one resource by ID using `GET`.elemental2.promise.Promise<elemental2.core.JsArray<T>> Fetch a collection.elemental2.promise.Promise<T> Update a resource using `PUT`.
-
Method Details
-
create
Create a resource using `POST`.- Parameters:
item- Request body to create.- Returns:
- Method result.
-
delete
Delete a resource by ID.- Parameters:
id- Resource identifier appended to the base URL.- Returns:
- Method result.
-
get
Fetch one resource by ID using `GET`.- Parameters:
id- Resource identifier appended to the base URL.params- Additional URI template or query parameters.- Returns:
- Method result.
-
list
elemental2.promise.Promise<elemental2.core.JsArray<T>> list(jsinterop.base.JsPropertyMap<Object> params) Fetch a collection. Parameters are used for URI template expansion and are also forwarded to `$http` as query params. Non-array responses resolve to an empty array.- Parameters:
params- Value supplied for the params parameter.- Returns:
- Method result.
-
update
Update a resource using `PUT`.- Parameters:
id- Resource identifier appended to the base URL.item- Request body to send.- Returns:
- Method result.
-