title: Angular 2 AbstractControl runtime
body: <p>I was following this answer <a href="https://stackoverflow.com/a/38064881/3874858">https://stackoverflow.com/a/38064881/3874858</a> to implement "Add more" ability to my Angular 2 application. Project, associated with this answer is uploaded on <a href="http://plnkr.co/edit/nHSIsciSZNTQzQjxkXsk?p=preview" rel="nofollow noreferrer">http://plnkr.co/edit/nHSIsciSZNTQzQjxkXsk?p=preview</a>. Unfortunately, to start this project, I have to comment these lines </p>
  
  <pre><code>this.form.controls.payOffs.push(this.createPayOffFormGroup(po))
  this.form.controls.payOffs.push(this.createPayOffFormGroup(emptyPayOff));
  console.log("Added New Pay Off", this.form.controls.payOffs)
  this.form.controls.payOffs.removeAt(index);
  </code></pre>
  
  <p>and type "npm start" and then uncomment. If I do not comment them, I get these errors: </p>
  
  <p>app/Components/companyInsertion.component.ts(37,28): error TS2339: Property 'payOffs' does not exist on type '{ [key: string]: AbstractControl; }'.
  app/Components/companyInsertion.component.ts(56,24): error TS2339: Property 'payOffs' does not exist on type '{ [key: string]: AbstractControl; }'.
  app/Components/companyInsertion.component.ts(57,57): error TS2339: Property 'payOffs' does not exist on type '{ [key: string]: AbstractControl; }'.
  app/Components/companyInsertion.component.ts(63,24): error TS2339: Property 'payOffs' does not exist on type '{ [key: string]: AbstractControl; }'.</p>
  
  <p>So, as I understand, this code works only on runtime. I tried this solution, but it didn't seemed to help:
  <a href="https://stackoverflow.com/questions/35987494/issue-with-typescript-compilation-in-angular2-forms">Issue with TypeScript compilation in Angular2 Forms</a>
  by changing</p>
  
  <pre><code>this.form.controls.payOffs.push(this.createPayOffFormGroup(po))
  </code></pre>
  
  <p>To</p>
  
  <pre><code>this.form.controls['payOffs'].value.push(this.createPayOffFormGroup(po))
  </code></pre>
  
  <p>So now I can run the app, but I extremely dislike the necessity to comment each time I start the server. Are there any solutions?</p>