• Overview
@angular/core

ModelSignal

interface

ModelSignal represents a special Signal for a directive/component model field.

  
    interface ModelSignal<T> extends WritableSignal<T> {}
  
  

set

void

Directly set the signal to a new value, and notify any dependents.

@paramvalueT
@returnsvoid

update

void

Update the value of the signal based on its current value, and notify any dependents.

@paramupdateFn(value: T) => T
@returnsvoid

asReadonly

Returns a readonly version of this signal. Readonly signals can be accessed to read their value but can't be changed using set or update methods. The readonly signals do not have any built-in mechanism that would prevent deep-mutation of their value.

@returnsSignal<T>

Registers a callback that is invoked whenever the output emits a new value of type T.

Angular will automatically clean up the subscription when the directive/component of the output is destroyed.

@paramcallback(value: T) => void
Jump to details