Skip to content

Getting Auxiliary Route Date (outlet)  #23

@MaxSassen

Description

@MaxSassen

Description

I couldn't find a way to access the outlet data that is stored in the secondary uri. So when working with Auxiliary Routes im forced to use the angular Activated Route.

  import { ActivatedRoute } from '@angular/router';
  import { RouterRepository } from '@ngneat/elf-ng-router-store';
  
  routerData$ = this.routerStore.selectData();
  outletData$ = this.route.data;
  constructor(   private routerStore: RouterRepository, private route: ActivatedRoute){}

routerData and outletData gives me another result.
example route users/overview(side:create)

Proposed solution

Introduce Outlet into elf-ng-router-store
current output:

{
  router: {
    state: {
      url: '/users/overview(side:create)',
      urlAfterRedirects: '/users/overview(side:create)',
      params: {},
      queryParams: {},
      fragment: null,
      data: {
        application: 'account',
        menu: 'users',
      }
    },
    navigationId: 1
  }
}

requested output:

Introduce Outlet into elf-ng-router-store
current output:

{
router: {
state: {
url: '/users/overview(side:create)',
urlAfterRedirects: '/users/overview(side:create)',
params: {},
queryParams: {},
fragment: null,
data: {
application: 'account',
menu: 'users',
},
outlets: [
{ url: '/create', data: { type: 'human' } }
]
},
navigationId: 1
}
}



### Alternatives considered

any other options :P 

### Do you want to create a pull request?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions