I see the pages
directory of many Ionic 2 projects is a flatted structure like below (if we use its generation command, the generated directory structure is flatted).
e.g.
pages/
|- login/
| |-login.html
| |-login.scss
| |_login.ts
|- logout/
| |-logout.html
| |-logout.scss
| |_logout.ts
|- order-list/
| |-order-list.html
| |-order-list.scss
| |_order-list.ts
|- order-detail/
| |-order-detail.html
| |-order-detail.scss
| |_order-detail.ts
But if a project includes many pages, i hope the pages
directory supports sub directories like below:
e.g.
pages/
|- auth/
| |- login/
| | |-login.html
| | |-login.scss
| | |_login.ts
| |- logout/
| | |-logout.html
| | |-logout.scss
| | |_logout.ts
|- order/
| |- list/
| | |-list.html
| | |-list.scss
| | |_list.ts
| |- detail/
| | |-detail.html
| | |-detail.scss
| | |_detail.ts
Does Ionic 2's pages
support this? The same question to others directory like providers
and pipes
.
Of course it does. In fact, instead of grouping things in terms of what they are (pages, providers, pipes, directives, and so on) I do prefer to group them in terms of what they do just like Angular 2 style guides recommends.
Just keep in mind that you'll have to update the references both in all the files and also in the components
templateUrl
property (if you're not using the RC version). Sowill turn into:
Yes. It does.
You just have to respect the nesting when importing the pages for your NgModule in src/app/app.module.ts