Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Set dynamic default route in SPA(angularjs) #756


User avatar
0
andmattia created

Hi

I need to set, dipending on my profile, where is the default route in angular.

in app.js how can I do that? suppose in core/application I have already store or set this parameter.

I think is a global user settings. Is it correct?


3 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    Hi,

    It's defined in app.js.

    Default: <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/blob/master/src/MyCompanyName.AbpZeroTemplate.Web/App/app.js#L61">https://github.com/aspnetzero/aspnet-ze ... app.js#L61</a>

    overrided for host: <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/blob/master/src/MyCompanyName.AbpZeroTemplate.Web/App/app.js#L133">https://github.com/aspnetzero/aspnet-ze ... pp.js#L133</a>

    overrided for tenant: <a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/blob/master/src/MyCompanyName.AbpZeroTemplate.Web/App/app.js#L166">https://github.com/aspnetzero/aspnet-ze ... pp.js#L166</a>

    Likewise you can override it conditionally.

  • User Avatar
    0
    andmattia created

    ok it's clear, but if I want that a user can define a page that want to see on start up where can I store this information? abpsession?

    if (abp.auth.hasPermission('Pages.Tenant.Dashboard')) { if (abp.auth.hasCustomRoute()) { $urlRouterProvider.otherwise(abp.auth.customRoute); }else{ $urlRouterProvider.otherwise("/tenant/dashboard"); }

  • User Avatar
    0
    hikalkan created
    Support Team

    Setting system is ideal for that. See documents: <a class="postlink" href="http://www.aspnetboilerplate.com/Pages/Documents/Setting-Management">http://www.aspnetboilerplate.com/Pages/ ... Management</a> You can define a setting, set a default value and allow users to override it. Then you can get the setting value in the client.