Created
December 11, 2019 17:57
-
-
Save adityatyagi/d3f6acb5ee1d9dcdaa9964d86172f0d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NgModule, SkipSelf, Optional } from "@angular/core"; | |
import { CommonModule } from "@angular/common"; | |
import { HttpClientModule } from "@angular/common/http"; | |
import { ProjectLayoutComponent } from "./layouts/project-layout/project-layout.component"; | |
import { NotFound404Component } from "./components/not-found404/not-found404.component"; | |
import { UtilityService } from "./utilities/utility.service"; | |
import { BaseService } from "./services/base.service"; | |
import { EnsureModuleLoadedOnceGuard } from "./guards/ensure-module-loaded-once.guard"; | |
import { HeaderComponent } from "./components/header/header.component"; | |
import { FooterComponent } from "./components/footer/footer.component"; | |
import { RouterModule } from "@angular/router"; | |
import { ScrollToTopComponent } from "./components/scroll-to-top/scroll-to-top.component"; | |
@NgModule({ | |
declarations: [ | |
ProjectLayoutComponent, | |
NotFound404Component, | |
HeaderComponent, | |
FooterComponent, | |
ScrollToTopComponent | |
], | |
imports: [CommonModule, RouterModule, HttpClientModule], | |
exports: [HttpClientModule], | |
providers: [BaseService, UtilityService] | |
}) | |
export class CoreModule extends EnsureModuleLoadedOnceGuard { | |
// Looks for the module in the parent injector to see if it's already been loaded (only want it loaded once) | |
constructor(@Optional() @SkipSelf() parentModule: CoreModule) { | |
super(parentModule); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment