Skip to content
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

Not able to create shared component #23

Closed
RajeshCherukuri opened this issue Oct 20, 2017 · 3 comments
Closed

Not able to create shared component #23

RajeshCherukuri opened this issue Oct 20, 2017 · 3 comments

Comments

@RajeshCherukuri
Copy link

Hi, I am not able to create a shared component which can be used in multiple views. Here is what I did

  1. Created a separate component inside components folder and added this component in index files and app.module
  2. I am trying to call that component from an HTML file which is inside a different module which is in views folder.

Here is the error I am receiving. Is that the right place to create a shared component? I did try creating a shared component inside views folder still no luck. Please suggest me where I am doing wrong. Thanks.

screen shot 2017-10-19 at 10 03 01 pm

@marcelofns
Copy link

I'm not sure, but components of app.module are not available to sub-modules. Have you tried to add the new component to your new component module, to declarations section?
Maybe you need a shared module to hold this: https://angular.io/guide/ngmodule#shared-modules

@kamal0808
Copy link

Did you try to export that component?

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants