pau-riquelme

Untitled

Jan 17th, 2018
724
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { BrowserModule } from '@angular/platform-browser';
  2. import { NgModule } from '@angular/core';
  3. import { RouterModule } from '@angular/router';
  4.  
  5. import { AppComponent } from './app.component';
  6. import { CommonComponentsModule } from './views/common/common-components.module';
  7.  
  8. @NgModule({
  9.   declarations: [
  10.     AppComponent
  11.   ],
  12.   imports: [
  13.     BrowserModule,
  14.     CommonComponentsModule,
  15.     /* --------------------------------------------------------------------
  16.       La configuración del lazyloading se realiza sobre la configuración de rutas de
  17.       la siguiente forma:
  18.      -------------------------------------------------------------------- */
  19.     RouterModule.forRoot([
  20.       /* --------------------------------------------------------------------
  21.         IMPORTANTE! Como vemos con 'loadChildren' hacemos referencia a la ruta donde se
  22.         encuentra el módulo, ¡No nos importamos el módulo! Ya que lo estamos delegando
  23.        -------------------------------------------------------------------- */
  24.       {path: "client", loadChildren: "./views/client/client.module#ClientModule"},
  25.       {path: "admin", loadChildren: "./views/admin/admin.module#AdminModule"}
  26.     ])
  27.   ],
  28.   providers: [],
  29.   bootstrap: [AppComponent]
  30. })
  31. export class AppModule { }
Advertisement
Add Comment
Please, Sign In to add comment