For example when a outside application need to visit your app address:
Https://www.example.com/#/lobby/abc
But before enter '/LOBBY/ABC ', user need to login, so the application would redirect user to
Https://www.example.com/#/login
Now what are you want are after the user logged in, can redirect them to
Https://www.example.com/#/lobby/abc
Instead of other pages like:
Https://www.example.com/#/lobby
So-solve the problem, we need to do, and things
1. Store The entry URL
2. After logged in, redirect user to entry URL
1. Store The entry ur:
Angular.module (' app ') // when the can get pull URL by using $location. Absurl () // Because run block only run once for the module and app module are our main application module, so this should onl Y store our entry URL / to reuse the Entryurl later, we store it in Loginservice . Run (($l Ocation, loginservice) = Loginservice.entryurl = $location. Absurl ())
2. After logged in, then we can redirect user to the entry URL by doing:
$location. URL (loginservice.entryurl)
[AngularJS] Store the entry URL and redirect to entry URLs after logged in