Closed
Description
OS?
Ubuntu 14.04 lts
Versions.
angular-cli: 1.0.0-beta.17
node: 5.6.0
Repro steps.
- ng new test
- cd test
- ng g module modulename
- cd src/app/modulename
- ng g directive directivename
The log given by the failure.
No failure
Expected result
Generates files:
- src/app/modulename/modulename.module.ts
- src/app/modulename/modulename.component.ts
- src/app/modulename/modulename.component..spec.ts
- src/app/modulename/modulename.component.html
- src/app/modulename/modulename.component.css
- src/app/modulename/directivename/directivename.directive.ts
- src/app/modulename/directivename/directivename.directive.spec.ts
Content of src/app/modulename/modulename.module.ts
:
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ModulenameComponent } from './modulename.component';
import { DirectivenameDirective } from './directivename/directivename.directive';
@NgModule({
imports: [
CommonModule
],
declarations: [ModulenameComponent, DirectivenameDirective]
})
export class ModulenameModule { }
Actual result (what's wrong - DIFF)
- src/app/modulename/directivename.directive.ts
- src/app/modulename/directivename.directive.spec.ts
Content of src/app/modulename/modulename.module.ts
:
// ...
import { DirectivenameDirective } from './modulename/directivename.directive';
// ...
Problem
ng g directive
does not behave likeng g component
, which generate output similar to theexpected
one.- Ignoring the 1. problem, it still generates wrong import path, resolving relative to src/app and not src/app/module.