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 Type
    Method
    Description
    elemental2.promise.Promise<T>
    create(T item)
    Create a resource using `POST`.
    elemental2.promise.Promise<Void>
    delete(ID id)
    Delete a resource by ID.
    elemental2.promise.Promise<T>
    get(ID id, jsinterop.base.JsPropertyMap<Object> params)
    Fetch one resource by ID using `GET`.
    elemental2.promise.Promise<elemental2.core.JsArray<T>>
    list(jsinterop.base.JsPropertyMap<Object> params)
    Fetch a collection.
    elemental2.promise.Promise<T>
    update(ID id, Object item)
    Update a resource using `PUT`.
  • Method Details

    • create

      elemental2.promise.Promise<T> create(T item)
      Create a resource using `POST`.
      Parameters:
      item - Request body to create.
      Returns:
      Method result.
    • delete

      elemental2.promise.Promise<Void> delete(ID id)
      Delete a resource by ID.
      Parameters:
      id - Resource identifier appended to the base URL.
      Returns:
      Method result.
    • get

      elemental2.promise.Promise<T> get(ID id, jsinterop.base.JsPropertyMap<Object> params)
      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

      elemental2.promise.Promise<T> update(ID id, Object item)
      Update a resource using `PUT`.
      Parameters:
      id - Resource identifier appended to the base URL.
      item - Request body to send.
      Returns:
      Method result.