Base solution for your next web application
Open Closed

Angular 6 Menu Parameter #5974


User avatar
0
velu created

I have routes that have parameters.

How do we add these to the AppMenuItem definitions?


5 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @velu,

    You can set it like below;

    new AppMenuItem('Users', 'Pages.Administration.Users', 'flaticon-users', '/app/admin/users',[],false, {id: 1, age: 2})

  • User Avatar
    0
    velu created

    Thanks for help.

    But how to read on landing page?

    Please guide us in detail.

  • User Avatar
    0
    ismcagdas created
    Support Team

    For the landing page, you need to modify root-routing.module.ts or auth-route-guard.ts

  • User Avatar
    0
    velu created

    Please check below mentioned code.

    new AppMenuItem('Transactions', '', 'flaticon-list-3', '', [ new AppMenuItem('Market', '', 'flaticon-app', '', [
    new AppMenuItem('Sell', null, 'fa fa-circle-o', '/app/main/Market', [], false, { MODE: 'S' }), new AppMenuItem('Buy', null, 'fa fa-circle-o', '/app/main/Market', [], false, { MODE: 'B' }) ]), ]),

    We are using same route for both menus. When we click first (Sell) menu Parameter value getting properly, But after clicking on Second (Buy) Menu we are not getting changed parameter value in queryParams.

    May be Market.component.ts page is not refreshed after clicking Second menu.

    this.modeText = this._activatedRoute.snapshot.queryParams['MODE'] || '';

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @velu

    I understand the problem now. Could you create an issue on https://github.com/aspnetzero/aspnet-zero-core/issues ? We will test and fix this for the next release.