title: Angular 7 - Display username after successful login
body: <p>I am using Angular 7 and Laravel to create user Login. Laravel serves the end point to Angular. I successfully created the user login, but I don't know how to display the logged in username</p>
  
  <p>I have done it that after successful login, it redirects to dashboard page.
  I created a service for the login (jarwis.service).</p>
  
  <pre><code>jarwis(login) service
  
  import { Injectable } from '@angular/core';
  import { HttpClient } from '@angular/common/http';
  
  @Injectable({
    providedIn: 'root'
  })
  export class JarwisService {
  
    private baseUrl = 'http://localhost/cloudengine-sandbox/cloudengine/public/api';
    //private baseUrl = '/api';
  
  
    constructor(private http:HttpClient) { }
  
    signup(data){
      return this.http.post(`${this.baseUrl}/signup`, data)
    }
    login(data){
      return this.http.post(`${this.baseUrl}/login`, data)
    }
  
    sendPasswordResetLink(data) {
      return this.http.post(`${this.baseUrl}/sendPasswordResetLink`,data)
    }
  }
  </code></pre>
  
  <p>login component</p>
  
  <pre><code>import { Component, OnInit } from '@angular/core';
  import { HttpClient } from '@angular/common/http';
  import { Subscriber } from 'rxjs';
  import { JarwisService } from '../../services/jarwis.service';
  import { TokenService } from '../../services/token.service';
  import { Router } from '@angular/router';
  import { AuthService } from '../../services/auth.service';
  
  @Component({
    selector: 'app-login',
    templateUrl: './login.component.html',
    styleUrls: ['./login.component.scss']
  })
  export class LoginComponent implements OnInit {
  
    public form = {
      email:null,
      password:null
    };
  
   public error = null;
    constructor(
      private Jarwis:JarwisService,
      private Token:TokenService,
      private router:Router,
      private Auth:AuthService
    ) { }
  
    onSubmit() {
    this.Jarwis.login(this.form).subscribe(
       data =&gt; this.handleResponse(data),
       error =&gt; this.handleError(error)
    );
    }
  
    handleResponse(data){
   this.Token.handle(data.access_token);
   this.Auth.changeAuthStatus(true);
   this.router.navigateByUrl('/home');
    }
  
  
    handleError(error){
   this.error = error.error.error;
    }
  
    ngOnInit() {
    }
  
  }
  </code></pre>
  
  <p>I want to display the username after successful login</p>