Angular 2 routing redirect to with child routes

I have been the same problem. It seems an Angular tricks:
If you remove leading slash in ‘redirectTo’ field, your application will be redirected successfully to auth/sign-in.

Use this in app.routing:

const routes: Routes = [ 

    {path: '', redirectTo: 'auth', pathMatch: 'full'}, 

];

‘redirectTo’ value starts with a ‘/’ = absolute path

‘redirectTo’ value starts without a ‘/’ = relative path

Read more about it: https://vsavkin.com/angular-router-understanding-redirects-2826177761fc

P.S My opinion that your structure more correctly then YounesM’s one. Parent module can’t keep children routes: “app” module don’t know that “auth” module have children module “sign-in”.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)