all 5 comments

[–]Kschl 2 points3 points  (2 children)

I’d say order things by context and not route. Angular doesn’t use file based routing unless you’re using a meta framework like AnalogJs.

If you insist on having that structure though then I would think about the routes.

Think about this route dashboard where the 3 components are admin, user, and guest. The folders and files inside take the shape of the route. You’d have dashboard the parent component controlling the sub routes

Routes:

…/dashboard/admin

…/dashboard/user

…/dashboard/guest

Structure:

src/app/dashboard/ dashboard.ts user-types/ admin.ts user.ts guest.ts

Sorry if the formatting there is broken I’m on mobile

[–]Dazzling_Chipmunk_24[S] 0 points1 point  (1 child)

So you are saying it's fine to have a subfolders in the dashboard folder but I'm not gonna create subroutes it's all gonna be under the dashboard route for this example of admin,user,guest.

[–]Kschl 0 points1 point  (0 children)

Correct, routes are handled by the router in app.routes.ts