ionic-framework icon indicating copy to clipboard operation
ionic-framework copied to clipboard

Generate new page

Open hoffmanjon opened this issue 9 years ago • 3 comments

Ionic version: (check one with "x") [ ] 1.x [X] 2.x

I'm submitting a ... (check one with "x") [ ] bug report [X] feature request [ ] support request => Please do not submit support requests here, use one of these channels: https://forum.ionicframework.com/ or http://ionicworldwide.herokuapp.com/

Current behavior: This request has two parts:

  1. When a new page is generated, we need to manually add the page to the app.module.ts file under declarations and also entryComponents. It would be nice to automatically add this when we run the command "ionic g page {nameOfPage}"
  2. When we generate a page with the command "ionic g page {nameOfPage}" the command does not check to see if the page/directory already exists.If it does exist it overwrites the existing page without asking or notifying the user. Overwriting an existing page is not ideal for the user.

Expected behavior:

  1. When we run the command "ionic g page {nameOfPage}", it would be preferable if the page was also added to the app.module.ts file so the user would not have to do that manually.
  2. If the page/directory already exist the command would generate an error and not overwrite the existing page

hoffmanjon avatar Jan 06 '17 12:01 hoffmanjon

Also please add support for sub-directories. E.g. "module1/page1" should generate Page1Page in "pages/module1/page1.ts" rather then Module1Page1Page in "pages/module1-page1.ts"

trakhimenok avatar Jan 06 '17 16:01 trakhimenok

This issue was moved to driftyco/ionic-cli#1838

brandyscarney avatar Jan 06 '17 17:01 brandyscarney

Thanks for the issue! This issue is being locked to prevent comments that are not relevant to the original issue. If this is still an issue with the latest version of Ionic, please create a new issue and ensure the template is fully filled out.

ionitron-bot[bot] avatar Sep 05 '18 07:09 ionitron-bot[bot]