title: How to display recieved form input data to other component in Angular 6?
body: <p>register.component.html (the form input component)</p>
  
  <pre><code>&lt;div class="card-content"&gt;
  
      &lt;form #registerForm="ngForm" (ngSubmit)="onSubmit(Name.value, Email.value)"&gt;
        &lt;div class="row"&gt;
          &lt;div class="input-field col s12"&gt;
            &lt;i class="material-icons prefix"&gt;account_circle&lt;/i&gt;
            &lt;input type="text" name="Name"
            #Name
            ngModel required&gt;
            &lt;label for="Name"&gt;Name&lt;/label&gt;
          &lt;/div&gt;
        &lt;/div&gt;
  
        &lt;div class="row"&gt;
          &lt;div class="input-field col s12"&gt;
            &lt;i class="material-icons prefix"&gt;mail_outline&lt;/i&gt;
            &lt;input type="text" name="Email"
            #Email
            ngModel
            required
            [pattern]="emailPattern"&gt;
            &lt;label for="Email"&gt;Email&lt;/label&gt;
          &lt;/div&gt;
        &lt;/div&gt;
  
        &lt;div class="row"&gt;
          &lt;div class="input-field col s12"&gt;
            &lt;button class="btn-large btn-submit"
            type="submit"
            [disabled]='!registerForm.valid'&gt;Start&lt;/button&gt;
          &lt;/div&gt;
        &lt;/div&gt;
  
      &lt;/form&gt;
  
    &lt;/div&gt;
  </code></pre>
  
  <p>register.component.ts
  ........................................................................................</p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { Router } from '@angular/router';
  import { QuizService } from '../shared/quiz.service';
  
  @Component({
    selector: 'app-register',
    templateUrl: './register.component.html',
    styleUrls: ['./register.component.scss']
  })
  export class RegisterComponent implements OnInit {
  
    emailPattern = '^[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,4}$';
  
    constructor(private route: Router, private quiz: QuizService) { }
  
    user = {
      username: '',
      email: ''
    };
  
    ngOnInit() {
    }
  
    onSubmit(name, email) {
      this.user.username = name;
      this.user.email = email;
  
      this.route.navigate(['quiz']);
      console.log(this.user.username, this.user.email); // log works!!
  
    }
  
  }
  </code></pre>
  
  <p>quiz.component.html (here i want to display the data which user entered in register component)
  .........................................................</p>
  
  <pre><code>&lt;div class="row"&gt;
    &lt;div class="col s6 offset-s3"&gt;
      &lt;h3&gt;Welcome to quiz&lt;/h3&gt;
  
      &lt;b&gt;Your Name is: &lt;/b&gt; 
      &lt;br&gt;
      &lt;b&gt;Your Email is: &lt;/b&gt;
    &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>