Angular How to make [formControl] optional field

In Angular, you can add attributes to inputs and make them optional using attr.

<input [type]="text" [attr.id]="id">

      

But how do you do shape control? I want something like this.

<input [type]="text" [attr.formControl]="someControl">

      

Should formControl not be set if someControl is undefined or null?

Any ideas? Thank.

+3


source to share





All Articles