Skip to content

fix(command/generate): directive selector should be camelcase #424

Description

@0x-r4bbit

Generating a directive using:

$ ng g directive my-directive

Generates a directive that looks like this:

@Directive({
selector: 'my-directive',
providers: [],
host: {},
})
class MyDirective {}

There are a two things that need a fix IMO:

  1. directive selectors should be camelcase, so instead of my-directive I should get myDirective
  2. providers and host are not necessarily needed maybe we can simply remove those?
  3. If we can't remove them, then the trailing comma and newline should be at least removed

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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