Angular-cli: `ng g component my-component` adds Backslashes on app.module.ts on Windows

Created on 15 Sep 2016  路  5Comments  路  Source: angular/angular-cli

Please provide us with the following information:

Environment :

Windows 10
angular-cli: 1.0.0-beta.14
node: 6.3.1
os: win32 x64

Reproduce

  1. App created on Windows, using angular-cli@webpack ng new newapp.
  2. Creating and moving to another folder inside the app root folder : mkdir app/feature && cd app/feature
  3. Creating a new component using the angular-cli@webpack ng g component my-component

    Error

Module not found: Error: Can't resolve './feature
egister-form/register-form.component' in 'E:\Dev\Learning\shooping-angular2\src\app'

Helpful informations

Details : On Windows, in the app.module.ts, the path is created using a backslash as first char after the current path.

import { RegisterFormComponent } from './feature\register-form/register-form.component';

should become:

import { RegisterFormComponent } from './feature/register-form/register-form.component';

Most helpful comment

All 5 comments

Same here

Environment :

angular-cli: 1.0.0-beta.11-webpack.8
node: 6.5.0
os: win32 x64

The issue is still there with the cli beta 15

angular-cli: 1.0.0-beta.15
node: 4.4.6
os: win32 x64

Anybody looking into it?

It'd be really nice if we could get a quick response from the team acknowledging this issue. This isn't some breaking bug, but given the cross-platform nature, proper path generation is more an expected functionality than a nice to have feature.

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

_This action has been performed automatically by a bot._

Was this page helpful?
0 / 5 - 0 ratings

Related issues

gotschmarcel picture gotschmarcel  路  3Comments

JanStureNielsen picture JanStureNielsen  路  3Comments

MateenKadwaikar picture MateenKadwaikar  路  3Comments

sysmat picture sysmat  路  3Comments

jmurphzyo picture jmurphzyo  路  3Comments