我的网站上有一个表格。(person.firstName、lastName、DOB、Gender、Citizenship 等...)。我的问题是如何观察整个形式的变化并从观察中得到两件事:
- formControl 及其当前状态
处理的 formControl 的当前值
前缀 {{availablePrefix}}
<div class="col"> <label for="firstName">First Name<span style="color: red"> *</span> </label> <input formControlName="party.firstName" type="text" autocomplete="off" id="firstName"/> </div> <div class="col"> <label for="middleName">Middle Name</label> <input formControlName="party.middleName" type="text" autocomplete="off" id="middleName" maxlength="1" /> </div> <div class="col"> <label for="lastName">Last Name<span style="color: red"> *</span> </label> <input formControlName="party.lastName" type="text" autocomplete="off" id="lastName"/> </div> <div class="col"> <label for="suffix">Suffix</label> <select formControlName="party.suffix" id="suffix"> <option [value]="availableSuffix" *ngFor="let availableSuffix of availableSuffixes">{{availableSuffix}} </option> </select> </div> </div> </form>
感谢您的任何帮助