Based on If condition I want make the field as required in angular2 -
<div *ngfor="let proc of procinputlist" > <label >{{proc.key_ | capitalize}}</label> <input id="{{proc.key_}}" name="inputparams" type ="text" class="form-control" required = "proc.r_q == y ? required :none" /> </div> but unfortunately not working me..and don't want use forms there.
to condition attibute can:
<input class="form-control" [required] = "proc.r_q == 'y'" />
Comments
Post a Comment