title: Submit Form in Angular4 and Material2
body: <p>I tried to build my first login form with Angular 4.0.0 with Material 2. But the Form won't submit and trigger the function. </p>
  
  <pre><code>&lt;form #UserLogin="ngForm" *ngIf="active" (ngSubmit)="onSubmit(UserLogin.value)"&gt;
  &lt;md-input-container&gt;
      &lt;input mdInput [(ngModel)]="data.email" ngControl="email" name="email" placeholder="Benutzername" type="text" required&gt;
  &lt;/md-input-container&gt;
  
  &lt;md-input-container&gt;
      &lt;input mdInput [(ngModel)]="data.password" ngControl="password" name="password" placeholder="Passwort" type="password" required&gt;
  &lt;/md-input-container&gt;
  
  &lt;button md-button class="submit-btn" type="submit" [disabled]="!UserLogin.form.valid"&gt;Login!&lt;/button&gt;
  </code></pre>
  
  <p></p>
  
  <p>The Submit function:</p>
  
  <pre><code>onSubmit(value: any) {
  
      console.log('sdfdfg');
  
      Object.assign(value, this.additionalData);
      this.submitted = true;
  
      this.auth.login(value).subscribe(
          data =&gt; {
              this.loginSuccess.emit(data);
          },
          error =&gt; {
              for (const field in this.formErrors) {
                  if (this.formErrors.hasOwnProperty(field)) {
  
                      this.formErrors[field] = [];
                      if (this.validationMessages[field].hasOwnProperty(error.systemCode)) {
                          this.formErrors[field].push(this.validationMessages[field][error.systemCode]);
                      }
                  }
              }
          }
      );
  
  }
  </code></pre>
  
  <p>When i click the login button, he does not print the console log into the console. Any idea why?</p>