We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d2ec558 commit aac6178Copy full SHA for aac6178
1 file changed
src/app/core/lazy-service.ts
@@ -7,6 +7,8 @@ import {
7
Observable,
8
} from 'rxjs';
9
10
+import { isNotEmpty } from '../shared/empty.util';
11
+
12
/**
13
* Loads a service lazily. The service is loaded when the observable is subscribed to.
14
*
@@ -26,7 +28,7 @@ export function lazyService<T>(
26
28
injector: Injector,
27
29
): Observable<T> {
30
return defer(() => {
- if (typeof loader === 'function') {
31
+ if (isNotEmpty(loader) && typeof loader === 'function') {
32
return loader()
33
.then((serviceOrDefault) => {
34
if ('default' in serviceOrDefault) {
0 commit comments