title: Angular2 - Redirect to calling url after successful login
body: <p>I have my application up and running with Angular 2.1.0.
  The routes are protected via router Guards, canActivate.</p>
  
  <p>When pointing the browser to a protected area like "localhost:8080/customers" I get redirected to my login page just like expected.</p>
  
  <p>But after a successful login, I would like to be redirected back to calling URL ("/customers" in this case). </p>
  
  <p>The code for handling the login looks like this</p>
  
  <pre class="lang-ts prettyprint-override"><code>login(event, username, password) {
    event.preventDefault();
    var success = this.loginService.login(username, password);
    if (success) {
      console.log(this.router);
      this.router.navigate(['']);
    } else {
      console.log("Login failed, display error to user");
    }
  }
  </code></pre>
  
  <p>The problem is, I don't know how to get a hold of the calling url from inside the login method.</p>
  
  <p>I did find a question (and answer) regarding this but couldn't really make any sense of it. 
  <a href="https://stackoverflow.com/questions/36160118/angular2-redirect-after-login">Angular2 Redirect After Login</a></p>