Angular HAL Client - v1.0.0-dev.7
    Preparing search index...

    Class Accessor

    This class provides a way to execute operations on HAL resources without reading them first. Accessors are obtained either by following resource links or by getting the root entry point for the API.

    Hierarchy

    • HalBase
      • Accessor
    Index

    Constructors

    • Parameters

      • obj: Object

        the object used to assign the properties

      Returns Accessor

    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 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<Accessor | undefined>

      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

    • Read the resource identified by self link.

      Type Parameters

      Parameters

      • type: Type<T>

        the resource type

      Returns Observable<T>

      an observable of the resource instance

    • Read the resource collection identified by self link.

      Type Parameters

      Parameters

      • type: Type<T>

        the collection element type

      Returns Observable<Collection<T>>

      an observable of the collection instance