How do I make a component, directive and pipe public? This is because when I add them to declarations array in a module, they become visible everywhere in the module where they are declared and are private to the module. If I've to use outside the module what should be done.
Make component, directive and pipe public and use outside a module
939 views Asked by Jyoti Prasad Pal At
2
You can use a shared Module which is responsible for sharing
common components, pipes and directives
.please note its just a naming convention to use
sharedModule or coreModule
, but you can use any other module nameeg xyzModule
. Import thing is that make sure common things are declared withinexport array
Use it in App/Root Module or any other feature or lazy loaded feature module like this,
AppModule Or let's say ClientModule