title: Can't send data to backend
body: <p>I would like to simply send the data to backend to register the user.</p>
  
  <p><strong>register.component.ts</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>import { Component, OnInit } from '@angular/core';
  import {FormBuilder, Validators} from '@angular/forms';
  import {RegisterService} from './register.service';
  
  @Component({
    selector: 'app-register',
    templateUrl: './register.component.html',
    styleUrls: ['./register.component.sass']
  })
  export class RegisterComponent implements OnInit {
    registerFormGroup = this.fb.group({
      email: ['', Validators.email],
      password: ['', Validators.pattern('^(?=.*?[A-Z])(?=.*?[a-z])(?=.*?[0-9])(?=.*?[#?!@$%^&amp;*-]).{8,}$')]
    });
  
    constructor(private fb: FormBuilder, private registerService: RegisterService) { }
  
    ngOnInit() {
      this.registerFormGroup.valueChanges.subscribe(inputFields =&gt; {
        console.log(this.registerFormGroup.value);
      });
    }
  
    // Submit the form
    private _onSubmit() {
      // There are some errors
      if (this.registerFormGroup.status === 'INVALID') {
        this.registerFormGroup.markAllAsTouched();
      } else {
        console.log('Ready to send'); // That works!
        // NO errors. Let's register the user
        this.registerService.register(this.registerFormGroup.value);
      }
    }
  
  }
  </code></pre>
  
  <p><strong>register.service.ts</strong></p>
  
  <pre class="lang-js prettyprint-override"><code>import { Injectable } from '@angular/core';
  import {HttpClient} from '@angular/common/http';
  
  @Injectable({
    providedIn: 'root'
  })
  export class RegisterService {
  
    constructor(private http: HttpClient) { }
  
    /**
     * @description Register the user
     * @param data JSON that includes E-Mail and password
     */
    public register(data) {
      return this.http.post('/register', data);
    }
  }
  </code></pre>
  
  <p>With <code>this.registerService.register(this.registerFormGroup.value);</code> I try to send data to backend but for some reason my server does not get a request. What am I doing wrong?</p>