funky-framadate-front/src/app/core/guards/module-import.guard.ts

6 lines
215 B
TypeScript
Raw Normal View History

2020-04-22 12:56:18 +02:00
export function throwIfAlreadyLoaded(parentModule: any, moduleName: string): void {
if (parentModule) {
throw new Error(`${moduleName} has already been loaded. Import ${moduleName} in the AppModule only.`);
}
}