Let's consider a scenario where we have a service named SomeService
that is defined within a library without the providedIn: root
injectable metadata configuration.
@Injectable()
export class SomeService { ...}
Now, in our application, we include SomeService
in the providers
array for bootstrapApplication
.
import { SomeService} from 'SomeLibrary';
bootstrapApplication(AppComponent, {
providers: [
SomeService,
],
});
The question arises whether this setup will create a singleton instance of SomeService
for the entire application similar to how providedIn: root
works.