title: angular 5 - redirect the previous page after sign in
body: <p>Angular 5 redirect to previous page after sign in.</p>
  
  <p>When I am hitting a url manually, if it is not logged in, it will redirect
  to login page but after login, it should redirect to url which entered but now I just can redirect to homepage by using this:</p>
  
  <pre><code>this.router.navigate(['/homepage']);
  </code></pre>
  
  <p>Have some ideas?</p>