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

Popular posts from this blog

What is happening when Matlab is starting a "parallel pool"? -

angular - DownloadURL return null in below code -

php - Cannot override Laravel Spark authentication with own implementation -