UNPKG

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
import { CommonModule } from '@angular/common'; import { NgModule, Optional, SkipSelf } from '@angular/core'; @NgModule({ declarations: [], imports: [CommonModule], exports: [], }) export class CoreModule { /* make sure CoreModule is imported only by the AppModule and noone else */ constructor(@Optional() @SkipSelf() presentInParent: CoreModule) { if (presentInParent) { throw new Error('CoreModule is already loaded. Import only in AppModule'); } } }