I am making forms through form builder in angularjs2, I want to add formControlName property/attribute of form element like this:
<input type="text" formControlName={{'client_name' + i}} placeholder="Required" />
How can I do this?
Edit:
I also want to put the validity message beside input element like this: How do I make the client_name inside the ngIf condition block dynamic as well?
<div *ngIf=“! userform.controls['client_name'].valid”>
Client Name is Not Valid
</div>
It should have same value as {{'client_name' + i}}
{{'client_name' + i}}It also might try to actually do addition, but that's an easy fix.