title: How to get current user id angular 4?
body: <p>I have to get current user ID to use it in different parts in my app..</p>
  
  <p>login.component.ts:</p>
  
  <pre><code>onSignin(form: NgForm){
  const UserName = form.value.UserName;
  const Password = form.value.Password;
  this.authService.signinUser(UserName,Password).map(res =&gt; res.json())
   .subscribe(
     data =&gt; {
       if (data.Id == 0){
       this.invalid=true;
      }
      else{
        localStorage.setItem('isLoggedin', 'true');
        this.router.navigate(['/calendar']);
        console.log('Ok');
     }})}
  </code></pre>
  
  <p>auth.service.ts:</p>
  
  <pre><code>signinUser(UserName,Password): Observable&lt;any&gt;{
    return this.http.get('http://api.##.com/api/security/signin?username='+UserName+'&amp;password='+Password);
  }
  </code></pre>