@angular/core

input

Initializer API

The input function allows declaration of Angular inputs in directives and components.

There are two variants of inputs that can be declared:

  1. Optional inputs with an initial value.
  2. Required inputs that consumers need to set.

By default, the input function will declare optional inputs that always have an initial value. Required inputs can be declared using the input.required() function.

Inputs are signals. The values of an input are exposed as a Signal. The signal always holds the latest value of the input that is bound from the parent.

  
    
  
  
Jump to details