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

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

inputBinding

function

Creates an input binding.

Binding inputs, outputs and setting host directives at creation

On this page

    arrow_upward_alt Back to the top

    API

    function inputBinding(publicName: string, value: () => unknown): Binding;
    @parampublicNamestring

    Public name of the input to bind to.

    @paramvalue() => unknown

    Callback that returns the current value for the binding. Can be either a signal or a plain getter function.

    Usage Example

    In this example we create an instance of the MyButton component and bind the value of the isDisabled signal to its disabled input.

    const isDisabled = signal(false);
    
    createComponent(MyButton, {
    bindings: [inputBinding('disabled', isDisabled)]
    });
    @returnsBinding
    Jump to details

    Web Proxy Viewer  |  New URL  |  Original Page