better-npm-init
Version:
A better version of npm init, with templates and more. Usage: better-npm-init <template> [--yarn] [--install] [--git] [--yes] [--help]
17 lines (15 loc) • 497 B
text/typescript
import { CommonModule } from '@angular/common';
import { NgModule, Optional, SkipSelf } from '@angular/core';
({
declarations: [],
imports: [CommonModule],
exports: [],
})
export class CoreModule {
/* make sure CoreModule is imported only by the AppModule and noone else */
constructor(() () presentInParent: CoreModule) {
if (presentInParent) {
throw new Error('CoreModule is already loaded. Import only in AppModule');
}
}
}