• Overview
@angular/forms/signals

MaybeField

Type Alias

Helper type for defining Field. Given a type TValue that may include undefined, it extracts the undefined outside the Field type.

API

    
      type MaybeField<TValue, TKey extends string | number = string | number> = | (TValue & undefined)  | Field<Exclude<TValue, undefined>, TKey>
    
    

Description

Helper type for defining Field. Given a type TValue that may include undefined, it extracts the undefined outside the Field type.

For example MaybeField<{a: number} | undefined, TKey> would be equivalent to undefined | Field<{a: number}, TKey>.

Jump to details