src/app/app.module.ts
import { AgmCoreModule } from '@agm/core';
import { AgmSnazzyInfoWindowModule } from '@agm/snazzy-info-window';
import { HttpClient, HttpClientModule } from '@angular/common/http';
import { NgModule, NO_ERRORS_SCHEMA } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { TranslateLoader, TranslateModule } from '@ngx-translate/core';
import { TranslateHttpLoader } from '@ngx-translate/http-loader';
import { AngularFireModule } from 'angularfire2';
import { AngularFireAuthModule } from 'angularfire2/auth';
import { AngularFirestoreModule } from 'angularfire2/firestore';
import { AngularFireStorageModule } from 'angularfire2/storage';
import { LazyLoadImageModule } from 'ng-lazyload-image';
import { MDBBootstrapModules, MDBSpinningPreloader } from 'ng-mdb-pro';
import { ToastModule } from 'ng-mdb-pro/pro/alerts';
import { environment } from '../environments/environment';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { DashboardAdminComponent } from './components/dashboard-admin/dashboard-admin.component';
import { DashboardEventCardComponent } from './components/dashboard-event-card/dashboard-event-card.component';
import { DashboardPhotographerComponent } from './components/dashboard-photographer/dashboard-photographer.component';
import { DashboardUserComponent } from './components/dashboard-user/dashboard-user.component';
import { EventPhotographerComponent } from './components/event-photographer/event-photographer.component';
import { EventUserComponent } from './components/event-user/event-user.component';
import { FooterComponent } from './components/footer/footer.component';
import { NavigationBarComponent } from './components/navigation-bar/navigation-bar.component';
import { PictureDetailComponent } from './components/picture-detail/picture-detail.component';
import { CheckoutPageComponent } from './pages/checkout-page/checkout-page.component';
import { DashboardPageComponent } from './pages/dashboard-page/dashboard-page.component';
import { DataProtectionPageComponent } from './pages/data-protection-page/data-protection-page.component';
import { EventPageComponent } from './pages/event-page/event-page.component';
import { EventSearchPageComponent } from './pages/event-search-page/event-search-page.component';
import { FeaturesPageComponent } from './pages/features-page/features-page.component';
import { GtcpageComponent } from './pages/gtcpage/gtcpage.component';
import { HomePageComponent } from './pages/home-page/home-page.component';
import { ImprintPageComponent } from './pages/imprint-page/imprint-page.component';
import { LoginPageComponent } from './pages/login-page/login-page.component';
import { PageNotFoundComponent } from './pages/page-not-found/page-not-found.component';
import { PaymentSuccessPageComponent } from './pages/payment-success-page/payment-success-page.component';
import { PhotoDetailPageComponent } from './pages/photo-detail-page/photo-detail-page.component';
import { PhotographerPageComponent } from './pages/photographer-page/photographer-page.component';
import { PhotographerSearchPageComponent } from './pages/photographer-search-page/photographer-search-page.component';
import { PricesPageComponent } from './pages/prices-page/prices-page.component';
import { ShoppingCartComponent } from './pages/shopping-cart/shopping-cart.component';
import { SignupPageComponent } from './pages/signup-page/signup-page.component';
import { BytesPipe } from './pipes/math/bytes/bytes.pipe';
import { ReplacePipe } from './pipes/string/replace/replace.pipe';
import { AlertService } from './services/alert/alert.service';
import { AuthGuard } from './services/auth/auth-guard/auth-guard.service';
import { FirebaseAuthService } from './services/auth/firebase-auth/firebase-auth.service';
import { RoleGuard } from './services/auth/role-guard/role-guard.service';
import { FirebaseFirestoreService } from './services/firebase/firestore/firebase-firestore.service';
import { FirebaseStorageService } from './services/firebase/storage/firebase-storage.service';
import { GeolocationService } from './services/geolocation/geolocation.service';
import { NavigationService } from './services/navigation/navigation.service';
/**
* Configures ngx-translate HttpLoader
* @param {HttpClient} http Http CLient
*/
export function HttpLoaderFactory(http: HttpClient) {
return new TranslateHttpLoader(http, './assets/i18n/', '.json');
}
@NgModule({
declarations: [
AppComponent,
EventPageComponent,
FooterComponent,
HomePageComponent,
NavigationBarComponent,
PageNotFoundComponent,
DashboardPageComponent,
CheckoutPageComponent,
SignupPageComponent,
LoginPageComponent,
PhotoDetailPageComponent,
PhotographerPageComponent,
PricesPageComponent,
FeaturesPageComponent,
ShoppingCartComponent,
ImprintPageComponent,
DataProtectionPageComponent,
DashboardUserComponent,
DashboardAdminComponent,
DashboardPhotographerComponent,
PhotographerSearchPageComponent,
EventUserComponent,
EventPhotographerComponent,
PictureDetailComponent,
DashboardPhotographerComponent,
GtcpageComponent,
DashboardEventCardComponent,
BytesPipe,
ReplacePipe,
EventSearchPageComponent,
PaymentSuccessPageComponent
],
imports: [
BrowserModule,
BrowserAnimationsModule,
AppRoutingModule,
FormsModule,
ReactiveFormsModule,
HttpClientModule,
AngularFireModule.initializeApp(environment.firebase),
AngularFireAuthModule,
AngularFirestoreModule,
AngularFireStorageModule,
MDBBootstrapModules.forRoot(),
ToastModule.forRoot(),
LazyLoadImageModule,
AgmCoreModule.forRoot({
apiKey: environment.agmKey
}),
AgmSnazzyInfoWindowModule,
TranslateModule.forRoot({
loader: {
provide: TranslateLoader,
useFactory: HttpLoaderFactory,
deps: [HttpClient]
}
})
],
providers: [
AuthGuard,
FirebaseAuthService,
FirebaseFirestoreService,
FirebaseStorageService,
MDBSpinningPreloader,
RoleGuard,
GeolocationService,
NavigationService,
AlertService
],
bootstrap: [AppComponent],
schemas: [NO_ERRORS_SCHEMA]
})
export class AppModule {}