Skip to content
Mihael Safaric edited this page Jan 19, 2023 · 1 revision

Link decorator is used for decorating model properties which are used only as a link. No actions will be performed for this property, it won't be included in the payload and no models will be created when fetched from a server.

Options

  • externalName: string
    • if your model property name and the property name fetched from the server are different, you can specify the external property name

Example

import { HalModel, ModelConfig } from 'ngx-hal';

export class User extends HalModel {
  @Link()
  propertyOwnership: string;

  @Link({
    externalName: 'previousPropertyOwnership'
  })
  oldPropertyOwnership: string;
}