what is the proper way to dynamically mark a field as required using Angular 2 Forms?
问题 Using Angular 2 (2.0.0), what is the recommended way to dynamically mark a field as required, using Angular Forms? In all of their examples, the required attribute is just added like: <input type="text" class="form-control" id="name" required> What if the model I'm binding to has an IsRequired property, that will be true/false? If I use something like: <input [(ngModel)]="field.Value" type="text" value="{{field.Value}}" [attr.required]="field.IsRequired"/> That renders on the page like (note