Skip to content

ng g component .\components\side-panel creates wrong entry in app.module.ts file #2229

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

Closed
nairvishal opened this issue Sep 19, 2016 · 5 comments

Comments

@nairvishal
Copy link

nairvishal commented Sep 19, 2016

Using :-
angular-cli: 1.0.0-beta.14
node: 4.5.0
os: win32 x64

I created a components folder inside app folder. So to create my component files directly inside the 'components' folder i used ng g component .\components\side-panel and it created the files correctly but the entry made in app.module.ts was like this
import { SidePanelComponent } from './components\side-panel/side-panel.component';
and that caused the below error.

Error:-
ERROR in [default] F:\Angular2Projects\TrialApp\src\app\app.module.ts:9:35
Cannot find module './componentsside-panel/side-panel.component'.

I manually corrected the slash in the link.

@Meligy
Copy link
Contributor

Meligy commented Sep 20, 2016

Try version 1.0.0-beta.15

f6fa1a5 looks like it fixes this, and it's included in 1.0.0-beta.15.

@filipesilva
Copy link
Contributor

Fixed in #1961

@nairvishal
Copy link
Author

I checked in 1.0.0-beta.15 its still creating backward slash instead of forward.
import { HomeComponent } from './components\home/home.component';

@filipesilva
Copy link
Contributor

@nairvishal I just tried with ng g component components/side-panel on windows and the slashes were right. Bear in mind that for these commands need to be ran with forward slashes (other slashes can also be escapes).

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants