Skip to content

Wrong Import Path of a component. #2419

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
manish7singh opened this issue Sep 29, 2016 · 5 comments
Closed

Wrong Import Path of a component. #2419

manish7singh opened this issue Sep 29, 2016 · 5 comments

Comments

@manish7singh
Copy link

manish7singh commented Sep 29, 2016

OS?

Windows 7

Versions.

angular-cli: 1.0.0-beta.16
node: 6.6.0
os: win32 x64

Repro steps.

  • Created a new component with the below command
    ng g component home/tabs/tab
  • The import statement in the AppModule.ts becomes incorrect
    import { TabComponent } from './home\tabs\tab/tab.component';

The log given by the failure.

  • Cannot find module './home abs ab/tab.component'.

Mention any other details that might be useful.

  • Every time I create a new component under an existing component the path of the import statement needs to be corrected manually.
    import { TabComponent } from './home/tabs/tab/tab.component';
  • That's a major fix to be done. Else creating components in the sub-folders would create an every time.
@celliott181
Copy link
Contributor

Please see #2132 and #2357.

You can't generate components in subdirectories right now because doing so pulls the path directly from the OS. Thanks to Windows prefering \ we get mix and match slashes in our paths.

@manish7singh
Copy link
Author

manish7singh commented Sep 30, 2016

So is it wrong to create a Child Component that way?
And if not then will this be supported in later versions?

@filipesilva
Copy link
Contributor

Dupe of #1719, has been fixed since.

@manish7singh
Copy link
Author

Thanks @filipesilva

@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