Title: Generated directive selector name should be camelcase · Issue #1216 · angular/angular-cli · GitHub
Open Graph Title: Generated directive selector name should be camelcase · Issue #1216 · angular/angular-cli
X Title: Generated directive selector name should be camelcase · Issue #1216 · angular/angular-cli
Description: Version $ ng --version (node:20286) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version. Could not start watchman; falling back to NodeWatcher for f...
Open Graph Description: Version $ ng --version (node:20286) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version. Could not start wat...
X Description: Version $ ng --version (node:20286) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version. Could not start wat...
Opengraph URL: https://github.com/angular/angular-cli/issues/1216
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Generated directive selector name should be camelcase","articleBody":"##### Version\n\n```\n$ ng --version\n(node:20286) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.\nCould not start watchman; falling back to NodeWatcher for file system events.\nVisit http://ember-cli.com/user-guide/#watchman for more info.\nangular-cli: 1.0.0-beta.6\nnode: 6.2.1\nos: linux x64\n```\n##### Repro steps\n\nThe following generate command produces a kebab case selector name instead of camelCase.\n\n```\n$ ng g directive shared/directives/wrap-if\n(node:20210) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.\nCould not start watchman; falling back to NodeWatcher for file system events.\nVisit http://ember-cli.com/user-guide/#watchman for more info.\ninstalling directive\n create src/app/shared/directives/wrap-if.directive.spec.ts\n create src/app/shared/directives/wrap-if.directive.ts\n```\n\nsrc/app/shared/directives/wrap-if.directive.ts\n\n```\nimport { Directive } from '@angular/core';\n\n@Directive({\n selector: '[wrap-if]'\n})\nexport class WrapIf {\n\n constructor() {}\n\n}\n```\n\nAs per the [styleguide](https://angular.io/docs/ts/latest/guide/style-guide.html#!#02-06),\n\n\u003e Do Use lower camel case for naming the selectors of our directives.\n\nI've passed `ng generate` the name in kebab case because the [README](https://github.com/angular/angular-cli#generating-components-directives-pipes-and-services) states so and follows the convention of passing the file name where file names should [use dashes to separate words in the descriptive name](https://angular.io/docs/ts/latest/guide/style-guide.html#02-02).\n\nI've read #424 and acknowledge that passing the name as camelCase to `ng generate` produces the correct selector but it is unintuitive and doesn't follow the [README](https://github.com/angular/angular-cli#generating-components-directives-pipes-and-services). I don't think we should make an exception to the convention of passing kebab case file names to `ng generate`.\n\nInstead of not modifying the selector name at all for directives, I think they should be modified to be camelCase as per the styleguide.\n","author":{"url":"https://github.com/Blasz","@type":"Person","name":"Blasz"},"datePublished":"2016-06-27T06:18:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":5},"url":"https://github.com/1216/angular-cli/issues/1216"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:93263b71-7b63-fa7e-339b-e792557e6cbe |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | CA02:170F68:A21DA8:CE87BF:6976BFAF |
| html-safe-nonce | e9b46e411b5b321e7c2527f8de71a6179876a1c76ed55cc8d43ffd1be0d7afdb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJDQTAyOjE3MEY2ODpBMjFEQTg6Q0U4N0JGOjY5NzZCRkFGIiwidmlzaXRvcl9pZCI6IjgwNzI1MTQ0OTc3MzEyODA4MTUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 0234e9eb4f65ea82b1df4af4be9e5dd3300435835ec226bf22c14f3e62eaa585 |
| hovercard-subject-tag | issue:162381123 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/angular/angular-cli/1216/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e50ec5b35b65a18ac26d32d0439b820ad12e54989c37850b614b69cde5bac545/angular/angular-cli/issues/1216 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e50ec5b35b65a18ac26d32d0439b820ad12e54989c37850b614b69cde5bac545/angular/angular-cli/issues/1216 |
| og:image:alt | Version $ ng --version (node:20286) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version. Could not start wat... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Blasz |
| hostname | github.com |
| expected-hostname | github.com |
| None | 032152924a283b83384255d9489e7b93b54ba01da8d380b05ecd3953b3212411 |
| turbo-cache-control | no-preview |
| go-import | github.com/angular/angular-cli git https://github.com/angular/angular-cli.git |
| octolytics-dimension-user_id | 139426 |
| octolytics-dimension-user_login | angular |
| octolytics-dimension-repository_id | 36891867 |
| octolytics-dimension-repository_nwo | angular/angular-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 36891867 |
| octolytics-dimension-repository_network_root_nwo | angular/angular-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 5b577f6be6482e336e3c30e8daefa30144947b17 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width