title: Resetting a form in Angular 2 after submit
body: <p>I am aware that Angular 2 currently lacks a way to easily reset a form to a pristine state. Poking around I have found a solution like the one below that resets the form fields.</p>
  
  <p>It has been suggested that I need to drop the control group and create a new one to rebuild the form as pristine. I am having difficulty figuring out the best way to do this. I know I need to wrap the form building within a function but I am running into errors when doing that within the constructor.</p>
  
  <p>What would be the best way to rebuild the control group to completely reset the form?</p>
  
  <pre class="lang-ts prettyprint-override"><code>class App {
  
      name: Control;
      username: Control;
      email: Control;
  
      form: ControlGroup;
  
      constructor(private builder: FormBuilder) {
  
          this.name = new Control('', Validators.required);
          this.email = new Control('', Validators.required);
          this.username = new Control('', Validators.required);
  
          this.form = builder.group({
              name: this.name,
              email: this.email,
              username: this.username
          });
      }
  
      onSubmit(value: any): void {  
          // code that happens when form is submitted
          // then reset the form
          this.reset();
      }
  
      reset() {
          for (let name in this.form.controls) {
              this.form.controls[name].updateValue('');
              this.form.controls[name].setErrors(null);
          }
      }
  }
  </code></pre>