Skip to content

Instantly share code, notes, and snippets.

@jd-apprentice
Last active February 20, 2022 00:21
Show Gist options
  • Save jd-apprentice/c41f7c040200daaee836c5dc9f29683d to your computer and use it in GitHub Desktop.
Save jd-apprentice/c41f7c040200daaee836c5dc9f29683d to your computer and use it in GitHub Desktop.
Module example angular
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 {}
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