Vladimir Despotovic
Vladimir Despotovic

Reputation: 3498

Angular input value from parent to child component doesn't work

I am trying to do a simple @Input and Angular simply refuses to take the value. I have the parent component, and inside its template I have:

<app-summary-data-row>
    [test] = "'ttt'"
</app-summary-data-row>

In the child component I have:

@Input() test: string;

In the child template I have: {{ test }} the value 'ttt' is simply not displayed. What can be the problem here?

Upvotes: 1

Views: 335

Answers (1)

Adrita Sharma
Adrita Sharma

Reputation: 22213

Syntax is wrong. Try like this:

<app-summary-data-row  [test]="'ttt'">   
</app-summary-data-row>

Upvotes: 2

Related Questions