Skip to content

Manually import newly created components in the right NgModules #79

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

Merged
merged 6 commits into from
Aug 20, 2018

Conversation

sis0k0
Copy link
Contributor

@sis0k0 sis0k0 commented Aug 17, 2018

Before we were delegating the task of declaring new components inside an NgModule to the external component schematic. However, this causes two problems:

  • If a custom web extension is used for the web files (f.e. app.module.web.ts), the external schematic won't find an NgModule to declare the new component in. That's because the external schematic looks only for files ending with .module.ts.
  • The component won't be declared inside the {N} module (app.module.tns.ts).

With these changes, the external component schematic is always called with skipImport: true and the new component is manually declared inside an appropriate NgModule (web, mobile or both).

The PR also adds a simple VSCode launch configuration for debugging unit tests.

fixes #78, #54

@sis0k0 sis0k0 requested review from vakrilov and sebawita August 17, 2018 17:07
@sis0k0 sis0k0 merged commit 13516d6 into master Aug 20, 2018
@sis0k0 sis0k0 deleted the sis0k0/components-imports branch August 20, 2018 11:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ng g c doesn't add the component to NgModule if custom extension is used
2 participants