Getting this straight before the app gets messy
I keep seeing Angular apps start out clean, then slowly turn into a junk drawer. A component lands in the wrong module. A service gets provided twice. Suddenly you have two different “singletons” and stuff acts haunted. So yeah, CoreModule vs SharedModule sounds like boring folder talk, but it’s actually about keeping your app from tripping over itself.
Here’s the simple idea I grab onto. CoreModule is for things that should exist one time for the whole app, like global services, interceptors, guards, and maybe a header layout shell if it truly belongs everywhere. You don’t sprinkle CoreModule around. You bring it in once, usually in AppModule or whatever bootstraps your app.
SharedModule is different. It’s the box of reusable parts you want everywhere without stress. Buttons, pipes, small components, common directives, maybe Angular Material modules bundled up so you don’t import them 50 times. Shared stuff is safe to import in feature modules because it should not create new service instances by accident.
The big trap is when SharedModule starts providing services or when CoreModule gets imported into lazy loaded feature modules. That’s where duplicate services happen and bugs get weird fast. So I’m going to keep pushing on one rule while writing this: core is once, shared is many. If something breaks that rule, I stop and fix it.
Quick ending
If you separate core and shared on purpose, your imports get calmer and your services stay single like they’re supposed to be. Less mystery behavior. Less “why is this not updating”. More predictable app.