fullstackproltd / AspNetCoreSpa

Asp.Net 7.0 & Angular 15 SPA Fullstack application with plenty of examples. Live demo:
https://aspnetcorespa.fullstackpro.co.uk
MIT License
1.47k stars 464 forks source link

have different layout for different modules #157

Closed iamhaaamed closed 6 years ago

iamhaaamed commented 6 years ago

How can I have different layout for different modules?

asadsahi commented 6 years ago

@h4m3d66 can you explain a little more about what layout are you taking about for different modules?

iamhaaamed commented 6 years ago

I have separate module for each section of my web application, for example one module for user account, one module for shopping,... I want each module have its own layout. How I can do that?

asadsahi commented 6 years ago

@h4m3d66 If you are looking to achieve different layouts such as different navigations etc I would suggest looking into https://docs.google.com/presentation/d/1o1zbqxe-Fn4IdGRYeVGFNQb1PSiOpjXvIsNHRC7Bk1w/edit. this explains one way to achieve this. Since each module has different navigations, you could achieve something similar by providing different components based on the route you are on.

crh225 commented 6 years ago

from @asadsahi link, we did something similar to image

Each route that gets loaded into the router outlet is a different module for us. We actually are taking each module and putting it into its own scoped (private) npm package for our different areas of our business. (Accouting, Logistics, ...) These modules for us are in a since, their own applications.

iamhaaamed commented 6 years ago

I want some module have completely different layout(master page) not just its main content, for example in some module I dont want left nav and I want right nav or I dont want have left nav or right nav at all.

asadsahi commented 6 years ago

@h4m3d66 link I sent of slides have demo links at the bottom as well. Have you looked at it?

What you are trying to achieve sounds similar to what Alex from angular core team mentioned in his presentation, that you can build dynamic views for different routes.

asadsahi commented 6 years ago

closing as this is outside scope of this project.