Hi,

you can use Router.navigateByUrl(url):

So for your example it should be:

this.router.navigateByUrl(prevComponent.urlPath);



Am Mittwoch, 3. Februar 2016 13:03:51 UTC+1 schrieb Zsolt Kovács:
>
> Hi,
>
> I need to implement login using routing. In principle all my components 
> need authentication, so I implemented custom router outlet, which redirects 
> to Login component and the login shall redirect back to the original 
> component. To achieve that the Login implements routerOnActivate(next, 
> prev) to store the previous component, and onSubmit() it shall be used to 
> redirect, but I could not figure out how to use the ComponentInstruction.
>
> Code is available here:
>
>
> https://github.com/kovax/cristal-webui/blob/master/src/app/directives/auth-router-outlet/auth-router-outlet.ts
>
> https://github.com/kovax/cristal-webui/blob/master/src/app/components/login/login.ts
>
> Thanks,
>
> Zsolt
>

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to