Cookies concent notice

This site uses cookies from Google to deliver its services and to analyze traffic.
Learn more
Skip to main content
This site is no longer updated.Head to Angular.devHome
/

This is the archived documentation for Angular v17. Please visit angular.dev to see this page for the current version of Angular.

InputSignalWithTransform

InputSignalWithTransform represents a special Signal for a directive/component input with a transform function.

See more...

      
      interface InputSignalWithTransform<T, TransformT> extends Signal<T> {
}
    

Child interfaces

See also

Description

Signal inputs with transforms capture an extra generic for their transform write type. Transforms can expand the accepted bound values for an input while ensuring value retrievals of the signal input are still matching the generic input type.

      
      class MyDir {
  disabled = input(false, {
    transform: (v: string|boolean) => convertToBoolean(v),
  }); // InputSignalWithTransform<boolean, string|boolean>

  click() {
    this.disabled() // always returns a `boolean`.
  }
}