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

subgenerator (endpoint) name validation #540

Closed
gion opened this issue Sep 10, 2014 · 1 comment
Closed

subgenerator (endpoint) name validation #540

gion opened this issue Sep 10, 2014 · 1 comment

Comments

@gion
Copy link

gion commented Sep 10, 2014

Hi,
I had an issue when creating a new endpoint with a snake-case name:

yo angular-fullstack:endpoint some-endpoint

Everything was created as expected except fot the variable names introduced inside the generated template files.
Even though the generated routes and filenames work ok with snake-case phrases - in this case:

some-endpoint.controller.js

the name should be formatted as a valid javascript variable in order to avoid these kind of situations:

exports.index = function(req, res) {
  SomeEndpoint.find(function (err, some-endpoint) {

Maybe the callback argument should be filled with the same classnamed version of the name.

@kingcody
Copy link
Member

I suggest cameledName for vars, anything wrong in particular with snake-case for routes and filesnames?

kingcody added a commit to kingcody/generator-angular-fullstack that referenced this issue Sep 10, 2014
Changes:
- remove unneeded code
- use runTest for endpoints as well
- test endpoints with different options
- test endpoints with various cased named

Exposes Bug:
See angular-fullstack#540
kingcody added a commit to kingcody/generator-angular-fullstack that referenced this issue Sep 10, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants