Setup

First thing you need to do is to enable ng-frrri's router middleware by wrapping your routes with the frrri() function.

It's important to wrap the routes provided to RouterModule with our frrri() function, so our middleware will run for every route.

app-routing.module.ts
import { frrri, operate } from '@ng-frrri/router-middleware';
import { staticBreadcrumb } from '@ng-frrri/router-middleware/operators';

const routes: Routes = [
    {
        path: '',
    },
];

@NgModule({
    declarations: [],
    imports: [
        CommonModule,
        RouterModule.forRoot(
            frrri(routes),
            {
                initialNavigation: 'enabled',
                urlUpdateStrategy: 'eager',
            },
        ),
    ],
    exports: [
        RouterModule,
    ],
})
export class AppRoutingModule { }

Have a look at posts-routing.module.ts in the ng-intergation on GitHub for more examples.

Last updated