-
Notifications
You must be signed in to change notification settings - Fork 12k
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
ng g directive generate wrong import in a module #2762
Comments
Found the difference is that the component blueprint has the option |
@Brocco can you have a look? |
If you want to know whether it was fixed in beta.18: No. Tested it :) |
This seems to be behaving as expected... ~/dev/mlb/bar (master): ng g module modulename
installing module
create src/app/modulename/modulename.module.ts
installing component
create src/app/modulename/modulename.component.css
create src/app/modulename/modulename.component.html
create src/app/modulename/modulename.component.spec.ts
create src/app/modulename/modulename.component.ts
~/dev/mlb/bar (master): ng g directive directivename
installing directive
create src/app/directivename.directive.spec.ts
create src/app/directivename.directive.ts modulename is created in it's own directory... as expected ...
import { DirectivenameDirective } from './directivename.directive';
@NgModule({
declarations: [
AppComponent,
DirectivenameDirective
]
... |
You are not creating it in a module, as I'v shown in the reproduction. As I'v said: Since you'v created it in src/app, it obviously works. I assume it is intended to work inside of modules, because the |
I followed your repro steps...
should they be?
With those repro steps I was able to reproduce this issue (I updated your repro steps above) FYI, this is also an issue with pipe generations. |
…into a module Fixes angular#2762
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
OS?
Versions.
Repro steps.
The log given by the failure.
No failure
Expected result
Generates files:
Content of
src/app/modulename/modulename.module.ts
:Actual result (what's wrong - DIFF)
Content of
src/app/modulename/modulename.module.ts
:Problem
ng g directive
does not behave likeng g component
, which generate output similar to theexpected
one.The text was updated successfully, but these errors were encountered: