Last active
February 20, 2022 00:21
-
-
Save jd-apprentice/c41f7c040200daaee836c5dc9f29683d to your computer and use it in GitHub Desktop.
Module example angular
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 } from '@angular/core'; | |
import { RouterModule, Routes } from '@angular/router'; | |
const routes: Routes = [ | |
{ | |
path: '', | |
loadChildren: () => | |
import('./views/home/home.module').then((m) => m.HomeModule), | |
data: { | |
title: 'Home', | |
}, | |
}, | |
{ | |
path: 'clientes', | |
loadChildren: () => | |
import('./views/clientes/clientes.module').then((m) => m.ClientesModule), | |
data: { title: 'Clientes', breadcrumb: 'Clientes' }, | |
}, | |
]; | |
@NgModule({ | |
imports: [RouterModule.forRoot(routes)], | |
exports: [RouterModule], | |
}) | |
export class AppRoutingModule {} |
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 } from '@angular/core'; | |
import { RouterModule, Routes } from '@angular/router'; | |
import { HomeComponent } from './home.component'; | |
const routes: Routes = [ | |
{ | |
path: '', | |
component: HomeComponent, | |
data: { | |
title: 'Home' | |
} | |
}, | |
]; | |
@NgModule({ | |
imports: [RouterModule.forChild(routes)], | |
exports: [RouterModule] | |
}) | |
export class HomeRoutingModule { } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment