Ng2 router should store destination route
See original GitHub issueTo avoid forgetting it as this is the last issue to solve before being able to remove ui-router completely from package.json
register-transition-hooks.ts
used to configure ui-router , it had 3 responsibilities on state transitions:
- store destination state in case to bring user to it later in case she has to login first
- support for external URLs in ui-router
- set page title
Only first one is not yet covered and relates to StateStorageService
that should probably be renamed to RouteStorageService
.
$transitions.onStart({}, (transition: Transition) => {
let $storageService = transition.injector().get(StateStorageService);
$storageService.storeDestinationState(transition.to(), transition.params(), transition.from());
let principal = transition.injector().get(Principal);
let auth = transition.injector().get(AuthService);
if (principal.isIdentityResolved()) {
auth.authorize();
}
<%_ if (enableTranslation) { _%>
// Update the language //FIXME not sure if this is required, its causing some weird error as well
/*let languageService = transition.injector().get(JhiLanguageService);
languageService.getCurrent().then(current => {
languageService.changeLanguage(current);
});*/
<%_ } _%>
});
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Common Routing Tasks - Angular
The order of routes is important because the Router uses a first-match wins strategy when matching routes, so more specific routes should be...
Read more >222 - Stack Overflow
To navigate a relative path with the Router.navigate method, you must supply the ActivatedRoute to give the router knowledge of where you are...
Read more >Location Strategy- Routing in Angular2 - Knoldus Blogs
Routing enables you to route the user to different components based on the url that they type on the browser, or that you...
Read more >Angular 2 Series - Part 4: Component Router In-Depth - Auth0
The router-outlet in the main App component can only show the Home route right now, but of course want to show others routes...
Read more >How to use Routing in Angular - malcoded
The Angular Router Module ... All routing related things are inside of the RouterModule. This module comes with angular. So to use routing,...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’m on it
I hope so
Thanks & Regards, Deepu
On Tue, Jan 24, 2017 at 10:19 AM, VictorADS notifications@github.com wrote: