
上QQ阅读APP看书,第一时间看更新
Adding form controls to our form inputs
Next, we start constructing the inputs for our form. We'll start with the input for the name of our exercise:
<input name="name" formControlName="name" class="form-control" id="name" placeholder="Enter exercise name. Must be unique.">
We assign the name of our coded form control to formControlName. This establishes the link between the control in our code and the input field in the markup. Another item of interest here is that we do not use the required attribute.