Hi Sander,

Thx for reply !

In my app routing i have this :

*export const appRoutes: Routes = [
>     {
>         path: 'driver',
>         component: MainLayoutComponent,
>         loadChildren: 'app/+driver/driver.module#DriverModule'
>     },
>     {
>         path: 'client',
>         component: MainLayoutComponent,
>         loadChildren: 'app/+client/client.module#ClientModule'
>     }
> ];
>
> export const AppRouting: ModuleWithProviders = 
> RouterModule.forRoot(appRoutes, {useHash: true});*
>
>
>
The driver and client and in separate folders 


driver/driver.component.ts
driver/driver.module.ts
driver/driver.routing.ts
driver/auth/auth.component.ts
driver/auth/auth.module.ts
driver/auth/auth.routing.ts


client/client.component.ts
driver/client.module.ts
client/client.routing.ts
client/auth/auth.component.ts
client/auth/auth.module.ts
client/auth/auth.routing.ts


In my client routing i have this :

*import {Routes, RouterModule} from "@angular/router";
>
>
> export const routes: Routes = [
>
>     {
>         path: 'auth',
>         loadChildren: './+auth/auth.module#AuthModule'
>     },
>
> ];
>
> export const routing = RouterModule.forChild(routes);*
>
>
And in my driver routing i have this : 

 

i*mport {Routes, RouterModule} from "@angular/router";*


> *export const routes: Routes = [*

*    {*

*         path: 'auth',*

*         loadChildren: './+auth/auth.module#AuthModule'*

*    }*

*];*


> *export const routing = RouterModule.forChild(routes);*




My auth routing contains this : 

 

*import {ModuleWithProviders} from "@angular/core"*

*import {Routes, RouterModule} from "@angular/router";*


>
> *export const routes: Routes = [*

*    {*

*        path: 'login',*

*        loadChildren: './+login/login.module#LoginModule'*

*    },*

*    {*

*        path: 'register',*

*        loadChildren: './+register/register.module#RegisterModule'*

*    },*

*    {*

*        path: 'forgot-password',*

*        loadChildren: './+forgot/forgot.module#ForgotModule'*

*    }*

*];*


> *export const routing: ModuleWithProviders = 
> RouterModule.forChild(routes);*


 

Thx for your help :) 


Le vendredi 17 novembre 2017 10:07:54 UTC+1, Sander Elias a écrit :
>
> Hi Maxine,
>
> If it's the same route, you can't have it point to different components. 
> The router doesn't know what to pick in that case, so it throws the error 
> you are seeing. If you need 2 different components, don't use the same 
> route. if it points to the same component, you don't need 2 routes to it.
>
> Regards
> Sander
>

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" 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