How to split a form into a number of separated components

Tags:

No documentation yet

Authors:Zhicheng Wang

<form #form="ngForm" (submit)="submit(form)" name="form" uiFormField>
  <div class="form-group" uiFormField>
    <label for="username">Username</label>
    <input [(ngModel)]="user.username" class="form-control"
           id="username" minlength="4" name="username" required/>
    <ui-field-error></ui-field-error>
  </div>

  <div class="form-group" uiFormField>
    <label for="email">Email</label>
    <input [(ngModel)]="user.email" class="form-control"
           email id="email" name="email" required/>
    <ui-field-error></ui-field-error>
  </div>

  <div class="form-group">
    <button class="btn btn-primary" type="submit">Submit</button>
    <button (click)="reset(form)" class="btn btn-secondary" type="button">Reset</button>
  </div>
  <ui-field-error></ui-field-error>
</form>

<app-json-viewer [value]="report"></app-json-viewer>