Do you know Angular services are not always singleton? How Angular service scope gets created?

Опубликовано: 24 Апрель 2026
на канале: FrontPro
2,636
77

Why my service behaviour is unexpected? How angular service works when provided at a different level like root level, with lazy loaded modules, or at the component level? What are module scoped services?

When Angular service creates a single object (singleton) or multiple instances?

This video describes all these questions with examples. See you in the video.

Video Content
--------------------------------------------------------------------------------------------------------------------------------------------------------
00:00 - What is singleton? Will verify it.
00:20 - What happens when we provide angular service in core module, lazy loaded module or in component?
00:50 - Different modules in the application and how we are going to use it.
01:10 - Application walkthrough - App module, core module and feature modules (Lazy loaded modules
02:00 - Lazy loading in action (demo how lazy loaded modules get downloaded in chunks)
02:32 - Walkthrough of Simple service which broadcast message to it's subscribers.
03:00 - What is app scoped service? Code walkthrough
04:37 - Explanation of app scoped service through a diagram.
05:17 - App scoped service in action
05:46 - Let's verify if angular service is singleton in app scope.
07:54 - What if we provide service in sub-module? Does it create more than one instance?

My gear for shooting this video
Microphone
https://amzn.to/3YmmZbi
MacBook
https://amzn.to/45dvQyg


Watch more videos

Angular Lazy Loading
   • Angular Lazy Loading Modules | Lazy Loadin...  

Small trick but can give a serious boost to your application performance.
*ngFor and Track by.
   • Angular Performance | *ngFor - trackBy | D...  

https://t.me/joinfrontpro
Or search “joinfrontpro” on Telegram

A Place where we 
Learn | Share | Grow 
FrontPro