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

How to use Boilerplate Framework to build App with two SPA #528


User avatar
0
khaled created

HI, I am beginner in ASP.NET Boilerplate Framework. I need to build web application with two SPA Areas one for public and other to authenticate throw ADFS, The two SPA areas should consume some shared application services but different navigation menus, how can I configure your template to build this.

Thanks in advance, Khaled


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

    Hi,

    That's why we created a Main folder inside the App folder (<a class="postlink" href="https://github.com/aspnetboilerplate/aspnetboilerplate-templates/tree/master/src/AbpCompanyName.AbpProjectName.WebSpaAngular/App">https://github.com/aspnetboilerplate/as ... ngular/App</a>).

    You can duplicate Main folder and create a second SPA. Surely, you can also create a second navigation provider, bundles and so on...

  • User Avatar
    0
    khaled created

    Thanks for your reply, I have copied the main folder as your guidance and surely I have got two SPAs, and I cannot figure out how to access second menu navigation provider at client side:

    vm.menu = abp.nav.menus.MainMenu;//how to access second navigation provider i have created.
    

    Thanks, Khaled

  • User Avatar
    0
    hikalkan created
    Support Team

    Like that:

    abp.nav.menus.YourSecondMenu
    

    Surely, you should define a menu named "YourSecondMenu" in the navigation provider:

    context.Manager.Menus["YourSecondMenu"] = new MenuDefinition...
    
  • User Avatar
    0
    khaled created

    Thanks for you gentle help.

    Now, I Have my custom two SPAs as: ~/Areas/Main/... ~/Areas/SecSpa/... one another question for you kind experience :) How can I use some shared cshtml views and their js controllers in both two SPAs? I am thinking, should I create shared folder like : ~/Areas/shared/views and put all shared cshtml and js files in or what do you think?

    Many thanks, Khaled

  • User Avatar
    0
    hikalkan created
    Support Team

    It's up to your design choice. That seems fine.