turbodombuilder - v0.9.66
    Preparing search index...

    Function expose

    • Function

      Parameters

      • rootKey: string
      • OptionalexposeSetter: boolean

      Returns any

      expose

      Stage-3 decorator that augments fields, accessors, and methods to expose fields and methods from inner instances.

      protected model: TurboModel;
      @expose("model") public color: string;

      Is equivalent to:

      protected model: TurboModel;

      public get color(): string {
      return this.model.color;
      }

      public set color(value: string) {
      this.model.color = value;
      }
    • Function

      expose

      Parameters

      • host: object

        The host object to define the exposed property on.

      • rootKey: string

        The property key of the inner instance to expose from.

      • key: string

        The property key to expose.

      • OptionalexposeSetter: boolean

        Whether to expose a setter for the property. Defaults to true.

      Returns void

      Imperatively exposes a specific field from an inner instance onto a host object.

      expose(this, "model", "color");
      expose(this, "model", "readonlyProp", false);