Ionic-cli: 2: Create page in sub-directory/folder [Feature request]

Created on 28 Mar 2016  路  10Comments  路  Source: ionic-team/ionic-cli

_From @alexbainbridge on March 26, 2016 11:3_

Short description of the problem:

When you have an app with a lot of pages, its easier to manage them in groups. e.g.

Concept A

  • page 1
  • page 2
  • page 3

Concept B

  • page 4
  • page 5
  • page 6

At the moment the ionic g page command creates pages (and their scss / js) at the top level "pages".

However I would like to do

ionic g page conceptA/pagename

and it to create pagename in pages > conceptA > pagename

Otherwise, I have to create a page, and then move it subsequently. This is a bit fiddly as quite a bit is auto-generated, so its not just a drag drop.

What behavior are you expecting?

Works as expected. Just this is an idea for an improvement

Which Ionic Version?
2

Run ionic info from terminal/cmd prompt: (paste output below)

Cordova CLI: 5.4.1
Ionic Version: 2.0.0-beta.3
Ionic CLI Version: 2.0.0-beta.19
Ionic App Lib Version: 2.0.0-beta.9
ios-deploy version: Not installed
ios-sim version: 5.0.4
OS: Mac OS X El Capitan
Node Version: v5.3.0
Xcode version: Xcode 7.3 Build version 7D175

_Copied from original issue: driftyco/ionic#5949_

All 10 comments

Hello! Thanks for opening an issue with us! As this feature request is more related to the ionic cli i will be moving this feature over there. Thanks again!

Whats the status with this?

any status on this?

Still not fixed :'(

I originally came up with this idea a year ago but since then I have changed my mind. I don't need it :)

  • very rarely generate a page anyway - much easier just to copy an existing one - chances are you as a developer have your own standard code that needs to be on each page - and by copying an existing one, you get that. There is nothing behind the scenes that requires a page to be created using generate, rather than copied from an existing..... (template, scss, ts)

  • regarding sub-folders, I use Webstorm, and it turns out if you drag a folder, it automatically sorts out everything you need to change (including app.module.ts and other imports), so even if you create in the wrong place, you can move anyway, painlessly

In summary, generate is not really needed much, and alternatives for creating / moving to a sub-folder exist. I can see why Ionic team left it, and thats fine by me!

So you all waiting for this - why do you actually need it? I thought I did but turns out I didn't

It would be helpful to have this feature, just being able to run ionic g page admin-login in a directory other than root directory.

even something like angular cli, where i could do something like ionic g page modals/my-modal which would create a modal in the pages/modals/ directory

Since a modal acts like a page, but delineation would definitely be nice!

Hey all, thanks for the feature request. This would be a great addition and I think should fit in nicely with this more general issue about our generators: https://github.com/ionic-team/ionic-cli/issues/2407

I am closing this in favor of the placeholder issue.

Nothing new?

@juandl This will be handled easily by the Angular CLI in v4. Please see https://github.com/ionic-team/ionic-cli/issues/3019 to get started testing.

Was this page helpful?
0 / 5 - 0 ratings