You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
380 B
16 lines
380 B
import { NgModule, Optional, SkipSelf } from '@angular/core';
|
|
import { CommonModule } from '@angular/common';
|
|
|
|
@NgModule({
|
|
declarations: [],
|
|
imports: [
|
|
CommonModule
|
|
]
|
|
})
|
|
export class CoreModule {
|
|
constructor(@Optional() @SkipSelf() parentModule: CoreModule) {
|
|
if(parentModule){
|
|
throw new Error('CoreModule 只允许在 AppModule 中加载。');
|
|
}
|
|
}
|
|
}
|