How do you pass data from a parent component to a child component?

Angular components and templates · Freshers

Model answer

Mark a property in the child as an input and bind it in the parent's template. In current Angular you write name = input<string>() in the child, and in the parent <app-child [name]="userName" />. The child reads it as name() because inputs created with input() are signals. In the classic style you use the @Input() decorator on a property.

Data flows down through inputs. The child sends information up with outputs.

Learn this topic

Angular Tutorial: Beginner to Advanced .

Sign in to add your own answer.

More questions