Skip to content

subgenerator (endpoint) name validation #540

@gion

Description

@gion

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions