title: Angular 5 cannot read property 'remove' of undefined
body: <p>So, I've been working my way into ASP.NET Core 2 and Angular 5 (I'm a Django/Rails Vue guy) and after doing some trivial examples I've decided to build one of my old products with the new stack. Thing is I'm having trouble figuring out the source of this error.</p>
  
  <p>Here is my login component template:</p>
  
  <pre><code>&lt;div class="login-container"&gt;
    &lt;h2 class="login-title"&gt;{{title}}&lt;/h2&gt;
    &lt;form [formGroup]="form" (ngSubmit)="onSubmit()" class="form-horizontal"&gt;
      &lt;div class="form-group" *ngClass="{' has-errors has-feedback' : hasErrors('Username')}"&gt;
        &lt;input type="text" formControlName="Username" class="form-control" required placeholder="Usuario o Email" /&gt;
      &lt;/div&gt;
      &lt;div class="form-group" *ngClass="{' has-errors has-feedback' : hasErrors('Password')}"&gt;
        &lt;input type="password" formControlName="Password" class="form-control" required placeholder="*****" /&gt;
      &lt;/div&gt;
      &lt;button type="submit" [disabled]="form.invalid" class="btn btn-md btn-success"&gt;Entrar&lt;/button&gt;
    &lt;/form&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>and here's the Typescript:</p>
  
  <pre><code>@Component({
    selector: 'app-login',
    templateUrl: './login.component.html',
    styleUrls: ['./login.component.css']
  })
  export class LoginComponent implements OnInit {
  
  
    title: string;
    form: FormGroup;
  
    constructor(private router: Router,
      private fb: FormBuilder,
      private authService: AuthService,
      @Inject('BASE_URL') private baseUrl: string) {
      this.title = 'Entrar';
    }
  
    ngOnInit(): void {
      this.createForm();
    }
  
    createForm() {
      this.form = this.fb.group({
        Username: ['', Validators.required],
        Password: ['', Validators.required]
      });
      console.log(this.form);
    }
    onBack() {
      this.router.navigate(['home']);
    }
    getFormControl(name: string) {
      return this.form.get(name);
    }
    isValid(name: string) {
      const e = this.getFormControl(name);
      return e &amp;&amp; e.valid;
    }
    isChanged(name: string) {
      const e = this.getFormControl(name);
      return e &amp;&amp; (e.dirty || e.touched);
    }
  
    hasErrors(name) {
      return this.isChanged(name) &amp;&amp; !this.isValid(name);
    }
  
    onSubmit() {
      const url = this.baseUrl + 'api/token/auth';
      const username = this.form.value.Username;
      const password = this.form.value.Password;
      this.authService.login(username, password)
        .subscribe(res =&gt; this.router.navigate(['home']),
          err =&gt; this.form.setErrors({ 'auth': 'Usuario o password incorrecto' }));
    }
  }
  </code></pre>
  
  <p>I've read similar questions in SO but eventually decided to post this because:</p>
  
  <ol>
  <li>As far as I can tell nothing in my template is <code>undefined</code> (I think the only binding here is the <code>form</code>)</li>
  <li>I'm not calling/reading nothing with the name <code>remove</code> in it.</li>
  </ol>
  
  <p>Thanks in advance.</p>