#Is it possible to run root path '' first before next route on direct paste?

3 messages · Page 1 of 1 (latest)

somber river
#

In the route below.... I really need resolver in the root path '' to run first. But if I do a direct paste /admin the root path gets skipped. Is there a way to make the root path resolver run and process in the root path first? The userPermissionsResolver consumes a api which the AdminGuard uses to determine permissions from that data.

    {
      path: '',
      canActivate: [OktaAuthGuard],
      resolve: { permissions: UserPermissionsResolver },
      children: [
        { path: '', component: SidenavComponent, outlet: 'sidenav' },
        { path: '', component: HomeComponent },
      ],
    },
    {
      path: 'admin',
      canActivate: [OktaAuthGuard],
      canActivateChild: [AdminGuard],
      loadChildren: () => import('../app/modules/admin/admin.module').then(m => m.AdminModule),
    },
peak abyss
#

Well the two are two entirely separate routes. If you are on /adminwhy would the resolvers for / run? You should add the resolver to /adminas well if it is needed there, too

somber river
#

I was thinking they would run on a lexi order