This class repesents an in-memory instance of a HAL resource.

Hierarchy (view full)

Constructors

Accessors

  • get canCreate(): boolean
  • This property is true when either methods array does not exist in the self link or the array exists and contains POST string. It is false otherwise.

    Returns boolean

  • get canDelete(): boolean
  • This property is true when either methods array does not exist in the self link or the array exists and contains DELETE string. It is false otherwise.

    Returns boolean

  • get canRead(): boolean
  • This property is true when either methods array does not exist in the self link or the array exists and contains GET string. It is false otherwise.

    Returns boolean

  • get canUpdate(): boolean
  • This property is true when either methods array does not exist in the self link or the array exists and contains PUT string. It is false otherwise.

    Returns boolean

  • get self(): string
  • The URI of self link.

    Returns string

Methods

  • Create a new resource in the collection identified by self link. It makes a POST call to the URI in self link and returns an observable for the call. The observable normally emits an accessor for the newly created resource or undefined if Location header was not returned by the call.

    Parameters

    • obj: any

      the payload for the POST method call

    Returns Observable<undefined | Accessor>

    an observable of the resource's accessor

  • Delete the resource identified by self link.

    Returns Observable<void>

    an observable that emits next signal on successful delete

  • Follow the relation link. Returns an accessor for the resource or undefined if no such relation exists.

    Parameters

    • rel: string

      the name of the relation link

    • params: Params = {}

      parameters for a templated link

    Returns undefined | Accessor

    an accessor for the linked resource or undefined

  • Returns a single embedded resource or undefined if no such embedded exists. If the named resource is an array it returns the first element.

    Type Parameters

    Parameters

    • type: Type<T>

      the resource type

    • rel: string

      the name of the embedded resource

    Returns undefined | T

    the resource or undefined

  • Returns an embedded array of resources or undefined if the named embedded does not exist. If the named resource is not an array it wraps the resource in an array.

    Type Parameters

    Parameters

    • type: Type<T>

      the element resource type

    • rel: string

      the name of the embedded resource array

    Returns undefined | T[]

    the resource array or undefined

  • Refresh the the resource. In other words, read the resource identified by self link.

    Returns Observable<Resource>

    an observable of the refreshed resource instance

  • Persit the resource. Uses PUT request to send the new resource state.

    Returns Observable<Accessor>

    an observable of resource accessor

Generated using TypeDoc