title: How to pass a variable from one component to another that is at the same level?
body: <p>How to pass a variable from one component to another that is at the same level? I have the user variable in the <code>Auth</code> component service</p>
  
  <pre><code>@Injectable({
    providedIn: 'root'
  })
  export class AuthService {
    private user: string = null;
  
    getUser() {
      return this.user;
    }
  
    setUser(username) {
      sessionStorage.setItem('username', username);
      this.user = sessionStorage.getItem('username');
      console.log('VAMOS!!!', this.user);
    }
  }
  </code></pre>
  
  <p>in the first component I inject it and if I get the value of the user variable then when the user authenticates I redirect it with <code>this.router.navigate (['/ meet'])</code> that is, I visualize the next component.</p>
  
  <p>In this next component called list-user in which I get <code>null</code> in <code>getUser ()</code>.</p>
  
  <pre><code>async ngOnInit() {
    console.log('HOY', this.authService.getUser());
  } 
  </code></pre>