Can anyone explain me this code:
this.router.navigate(['/login'], { queryParams: { returnUrl: state.url } });
What does this code do. What is returnUrl? I searched Angular docs but couldn't find more about it where is it narrated.
Edit Added after getting this much help and based on my understanding:: ReturnUrl is a programmer defined queryparem ReturnUrl is used to make a user navigate to the url he was trying to access after login. For example at first the user might be trying to navigate to dashboard but he will not be allowed as it is auth guarded. but on login the returnUrl query parames is used to help the user navigate back to the dashboard.