• Overview
@angular/core

twoWayBinding

function

Creates a two-way binding.

API

  
    function twoWayBinding(  publicName: string,  value: WritableSignal<unknown>): Binding;
  
  

twoWayBinding

Binding

Creates a two-way binding.

@parampublicNamestring
@paramvalueWritableSignal<unknown>

Writable signal from which to get the current value and to which to write new values.

Usage example

In this example we create an instance of the MyCheckbox component and bind to its value input using a two-way binding.

          
const checkboxValue = signal('');createComponent(MyCheckbox, {bindings: [twoWayBinding('value', checkboxValue),],});
@returnsBinding
Jump to details