Skip to content

Instantly share code, notes, and snippets.

@NyaGarcia
Last active July 10, 2023 11:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NyaGarcia/6e9a1e43117445976bb7834c1b5c1570 to your computer and use it in GitHub Desktop.
Save NyaGarcia/6e9a1e43117445976bb7834c1b5c1570 to your computer and use it in GitHub Desktop.
NgBytes Standalone App Routing Module
import { RouterModule, Routes, provideRouter, withComponentInputBinding } from '@angular/router';
import { NgModule } from '@angular/core';
import { PokemonListComponent } from './pokemon-list/pokemon-list.component';
const routes: Routes = [
{ path: '', pathMatch: 'full', redirectTo: 'pokemon' },
{
path: 'pokemon',
component: PokemonListComponent,
},
{
path: 'details/:id',
loadComponent: () =>
import('./pokemon-detail/pokemon-detail.component').then(
(m) => m.PokemonDetailComponent
),
},
];
@NgModule({
imports: [RouterModule.forRoot(routes)],
exports: [RouterModule],
providers: [
provideRouter(appRoutes, withComponentInputBinding()),
]
})
export class AppRoutingModule {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment