diff options
Diffstat (limited to 'webapp/src/app/@core-xds/module-import-guard.ts')
-rw-r--r-- | webapp/src/app/@core-xds/module-import-guard.ts | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/webapp/src/app/@core-xds/module-import-guard.ts b/webapp/src/app/@core-xds/module-import-guard.ts new file mode 100644 index 0000000..445640c --- /dev/null +++ b/webapp/src/app/@core-xds/module-import-guard.ts @@ -0,0 +1,5 @@ +export function throwIfAlreadyLoaded(parentModule: any, moduleName: string) { + if (parentModule) { + throw new Error(`${moduleName} has already been loaded. Import Core modules in the AppModule only.`); + } +} |