angular-toolkit icon indicating copy to clipboard operation
angular-toolkit copied to clipboard

[request] CLI register page module to current router

Open rdlabo opened this issue 5 years ago • 5 comments

I think ionic g pg command should page module to current router. Now, all page module registered to src/app/app-routing.module.ts .

For example: in tabs template, $ ionic g pg tab1/sample register SamplePageModule to src/app/app-routing.module.ts. I expect register to src/tab1/tab1.module.ts. generate pipe works like this.

Thanks.

rdlabo avatar Apr 19 '19 02:04 rdlabo

@mhartington Thoughts?

imhoffd avatar Apr 19 '19 15:04 imhoffd

I'd like to avoid magic resolution like this. Maybe a flag to pass the router-module you'd like to use?

ionic g page shop/user-card --router-module src/pages/shop-router.module.ts

I do not think this will ever be perfect, as once tabs are used, the structure could be really unpredictable. I wonder if keeping it as it is, is the safest option, and let users move the router if they want to. Or maybe an flag to disable the router from being added to a router-module?

mhartington avatar Apr 19 '19 20:04 mhartington

@mhartington @dwieeb Thanks for reply. I understood.

Maybe a flag to pass the router-module you'd like to use?

I think to pass the router-module is difficult for user. It is easier to understand focus on app-routing.module.ts .

flag to disable the router is very good!! If use modal-page, this flag is very useful!!

rdlabo avatar Apr 22 '19 08:04 rdlabo

@mhartington @dwieeb This flug is --page-only or else? And I want to get --no-module flag. If use this flag, don't create module, and link page to src/app/app-routing.module.ts.

flag create module link module and router
(none) Lazy Loading
--page-only
--no-module Normal Loading

I think try to implement this. What do you think?

rdlabo avatar Apr 26 '19 02:04 rdlabo

@mhartington @dwieeb What do you think? Can I make a start in??

rdlabo avatar May 30 '19 02:05 rdlabo