[ Web Proxy ]
URL:
Viewing: https://angular.dev/api/core/InputSignalWithTransform [Back]  [Original]

InputSignalWithTransform Angular Skip to main content
menu
close
more_horiz
menuAPI
@angular/core

InputSignalWithTransform

interface
stablesince v19.0

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

InputSignal

On this page

    arrow_upward_alt Back to the top

    API

        
          interface InputSignalWithTransform<T, TransformT> extends Signal<T> {  [SIGNAL]: InputSignalNode<T, TransformT>;}
        
        

    [SIGNAL]

    InputSignalNode<T, TransformT>

    Description

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

    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`.
      }
    }
    Jump to details

    Web Proxy Viewer  |  New URL  |  Original Page