SHARE
TWEET

Untitled

a guest Jun 24th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. error in app.module.ts Error: Uncaught (in promise): Error: Cannot find module './pages/auth/login/login.module'
  2. Error: Cannot find module './pages/auth/login/login.module'
  3.      
  4. import { ErrorHandler, NgModule } from '@angular/core';
  5.         import { BrowserModule } from '@angular/platform-browser';
  6.         import { RouteReuseStrategy } from '@angular/router';
  7.  
  8.         import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
  9.         // AoT requires an exported function for factories
  10.         export function HttpLoaderFactory(http: HttpClient) {
  11.             return new TranslateHttpLoader(http, 'assets/i18n/')
  12.         }
  13.  
  14.  
  15.  
  16.         class MyErrorHandler implements ErrorHandler {
  17.         handleError(error) {
  18.             console.log("error in app.module.ts", error);
  19.         }
  20.         }
  21.  
  22.  
  23.         @NgModule({
  24.         declarations: [AppComponent],
  25.         entryComponents: [],
  26.         imports: [
  27.             BrowserModule,
  28.             IonicModule.forRoot(),
  29.             AppRoutingModule,
  30.             HttpClientModule,
  31.             TranslateModule.forRoot({
  32.                 loader: {
  33.                     provide: TranslateLoader,
  34.                     useFactory: HttpLoaderFactory,
  35.                     deps: [HttpClient]
  36.                 }
  37.             }),
  38.             AngularFireModule.initializeApp({
  39.             }),
  40.             AngularFireDatabaseModule,
  41.             // Put your custom imports below this line to make merges in Git easier  
  42.             FormsModule,
  43.             ReactiveFormsModule,
  44.             ],  
  45.         providers: [
  46.                 {provide: ErrorHandler, useClass: MyErrorHandler}, // had to add a custom error handler class here as IonicErrorHandler deprecated -
  47.                 { provide: RouteReuseStrategy, useClass: IonicRouteStrategy }
  48.         ],
  49.         bootstrap: [AppComponent]
  50.         })
  51.         export class AppModule {}
  52.      
  53. import { NgModule } from '@angular/core';
  54.         import { PreloadAllModules, RouterModule, Routes } from '@angular/router';
  55.  
  56.         const routes: Routes = [
  57.         { path: '', redirectTo: 'home', pathMatch: 'full' },
  58.         { path: 'login', loadChildren: './pages/auth/login/login.module#LoginPageModule' },
  59.         { path: 'home', loadChildren: './pages/home/home.module#HomePageModule' },
  60.         ];
  61.  
  62.         @NgModule({
  63.         imports: [
  64.             RouterModule.forRoot(routes, { preloadingStrategy: PreloadAllModules })
  65.         ],
  66.         exports: [RouterModule]
  67.         })
  68.         export class AppRoutingModule { }
  69.      
  70. import { NgModule } from '@angular/core';
  71.         import { CommonModule } from '@angular/common';
  72.         import { FormsModule, ReactiveFormsModule } from '@angular/forms';
  73.         import { Routes, RouterModule } from '@angular/router';
  74.         import { TranslateModule} from "@ngx-translate/core"
  75.         import { IonicModule } from '@ionic/angular';
  76.  
  77.         import { LoginPage } from './login.page';
  78.  
  79.         const routes: Routes = [
  80.         {
  81.             path: '',
  82.             component: LoginPage
  83.         }
  84.         ];
  85.  
  86.         @NgModule({
  87.         imports: [
  88.             CommonModule,
  89.             FormsModule,
  90.             IonicModule,
  91.             ReactiveFormsModule,    
  92.             TranslateModule,
  93.             RouterModule.forChild(routes)
  94.         ],
  95.         declarations: [LoginPage]
  96.         })
  97.         export class LoginPageModule {}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top