Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RC-0: Name pattern of generated pages #1442

Closed
jgw96 opened this issue Sep 30, 2016 · 12 comments
Closed

RC-0: Name pattern of generated pages #1442

jgw96 opened this issue Sep 30, 2016 · 12 comments

Comments

@jgw96
Copy link
Contributor

jgw96 commented Sep 30, 2016

From @ecureuill on September 29, 2016 20:7

Short description of the problem:

Ionic CLI generate page command doesn't add 'Page' sufix to the class name

What behavior are you expecting?

When generating new page through ionic cli, the class name of the .ts file generated should contains Page at the end of the name

@Component({
  templateUrl: 'build/pages/home/home.html',
})
export class HomePage {}

Steps to reproduce:

  1. ionic start myApp --v2
  2. ionic build
  3. ionic g page myPage
@Component({
  templateUrl: 'build/pages/home/home.html',
})
export class Home {}

Other information: (e.g. stacktraces, related issues, suggestions how to fix, stackoverflow links, forum links, etc)

Like in ionic beta, set "Page" to the ClassName variable

function PageGenerator(options) {
  Generator.call(this, options);
  this.directory = 'pages';
  this.jsClassName += 'Page';
}

Which Ionic Version? 1.x or 2.x
2 RC0

Run ionic info from terminal/cmd prompt: (paste output below)
Cordova CLI: 6.3.1
Gulp version: CLI version 3.9.1
Gulp local:
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
OS: Distributor ID: Debian Description: Debian GNU/Linux 8.6 (jessie)
Node Version: v4.5.0

Copied from original issue: ionic-team/ionic-framework#8320

@jgw96
Copy link
Contributor Author

jgw96 commented Sep 30, 2016

From @ramonornela on September 30, 2016 14:20

Not see problem Uninstall Ionic CLI first, and then reinstall

Important: if you have installed the beta cli you should run npm uninstall -g ionic first. You need version 2.1.0 for this release. Check your cli version by running ionic -v in the command line.

Thanks

@ramonornela
Copy link

Close issue reproduced in project https://github.com/ramonornela/ionic_playground_rc0/commit/93fd132c7bd019f135241b06ca4a801a6f96077f installed cli local in project.

see page created https://github.com/ramonornela/ionic_playground_rc0/blob/93fd132c7bd019f135241b06ca4a801a6f96077f/src/pages/my-page/my-page.ts

Code reported are of the templates of beta.11.

node_modules/.bin/ionic g page myPage

Thanks

@ecureuill
Copy link

I have uninstalled ionic cli before installed the rc

In beta
ionic g page myTeste generates myTestePage class

In RC
ionic g page myTeste generates myTeste class

@ramonornela
Copy link

Please run ionic info in the folder project and paste

@ecureuill
Copy link

ecureuill commented Sep 30, 2016

Your system information:

Cordova CLI: 6.3.1
Gulp version: CLI version 3.9.1
Gulp local:
Ionic Framework Version: 2.0.0-rc.0
Ionic CLI Version: 2.1.0
Ionic App Lib Version: 2.1.0-beta.1
OS: Distributor ID: Debian Description: Debian GNU/Linux 8.6 (jessie)
Node Version: v4.5.0

*** When I open the issue, I give a bad exemple in step 3 ionic g page myPage. My previous comment has a better exemple, instead.

@ramonornela
Copy link

What version NPM?

@ecureuill
Copy link

$ npm --v
3.10.6

@ramonornela
Copy link

1 - Install bin in project npm install ionic@latest
2 - Create page node_modules/.bin/ionic g page myTeste

@ramonornela
Copy link

Is suffix, problem with template generator in Ionic

Thanks

@ramonornela
Copy link

Related ionic-team/ionic-framework#8368

@yelhouti
Copy link

yelhouti commented Dec 7, 2016

Hey guys, thank you for the great work.
Are you guys planing to fix this by any chance any time soon?

@ionitron-bot
Copy link

ionitron-bot bot commented Jul 12, 2018

Thanks for the issue! This issue appears to be associated with an old version of the Ionic CLI. Please update to the latest CLI version, which supports all versions of the Ionic Framework. If the issue is relevant and if it persists after updating to the latest CLI version, please create a new issue.

Thank you for using Ionic!

@ionitron-bot ionitron-bot bot closed this as completed Jul 12, 2018
@ionitron-bot ionitron-bot bot locked and limited conversation to collaborators Jul 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants