Millwork
    Preparing search index...

    Function field

    • Declares a field of a shape or value class.

      • @field accessor city!: string: a plain JSON field.
      • @field('money', { wire: 'decimal' }) accessor total!: Money: a codec field.
      • @field(Address) accessor shipTo!: Address: a nested shape (or value) class.
      • @field(LineItem, { array: true, key: 'sku' }) accessor items!: ShapeArray<LineItem>.
      • @field({ card: Card, bank: Bank }, { discriminator: '$type' }): polymorphic.

      Ember compiles decorators with legacy semantics. There, use declare: @field('money') declare total: Money.

      Type Parameters

      • This
      • V

      Parameters

      • target: ClassAccessorDecoratorTarget<This, V>
      • context: ClassAccessorDecoratorContext<This, V>

      Returns ClassAccessorDecoratorResult<This, V>

    • Declares a field of a shape or value class.

      • @field accessor city!: string: a plain JSON field.
      • @field('money', { wire: 'decimal' }) accessor total!: Money: a codec field.
      • @field(Address) accessor shipTo!: Address: a nested shape (or value) class.
      • @field(LineItem, { array: true, key: 'sku' }) accessor items!: ShapeArray<LineItem>.
      • @field({ card: Card, bank: Bank }, { discriminator: '$type' }): polymorphic.

      Ember compiles decorators with legacy semantics. There, use declare: @field('money') declare total: Money.

      Parameters

      • prototype: object
      • key: string

      Returns void

    • Declares a field of a shape or value class.

      • @field accessor city!: string: a plain JSON field.
      • @field('money', { wire: 'decimal' }) accessor total!: Money: a codec field.
      • @field(Address) accessor shipTo!: Address: a nested shape (or value) class.
      • @field(LineItem, { array: true, key: 'sku' }) accessor items!: ShapeArray<LineItem>.
      • @field({ card: Card, bank: Bank }, { discriminator: '$type' }): polymorphic.

      Ember compiles decorators with legacy semantics. There, use declare: @field('money') declare total: Money.

      Parameters

      Returns FieldDecorator