Skip to content

Latest commit

 

History

History

app-shell-routing-adaptors

App Shell Routing Adaptors

What.

Routing adaptors for @jamesbenrobb/app-shell

How.

Standard Angular routes

Use getJBRAppShellAngularRouterProviders.

  1. Converts the routes registered through provideRouter(routes) into a NavConfig
  2. Creates a route manager to enable/manage 2 way communication between the Angular Router and app shell navigation

demo / example source

import {ApplicationConfig} from "@angular/core";
import {provideRouter} from "@angular/router";
import {getJBRAppShellProviders} from "@jamesbenrobb/app-shell";
import {getJBRAppShellAngularRouterProviders} from "@jamesbenrobb/app-shell-routing-adaptors";
import {routes} from "app.routes";


export const appConfig: ApplicationConfig = {
  providers: [
    provideRouter(routes),
    getJBRAppShellProviders(),
    getJBRAppShellAngularRouterProviders()
  ]
};



Dynamic routes

For use with @jamesbenrobb/dynamic-routes-ngx

demo / example source

import {ApplicationConfig} from "@angular/core";
import {provideRouter} from "@angular/router";
import {getJBRAppShellProviders} from "@jamesbenrobb/app-shell";
import {getJBRAppShellDynamicRoutesNgxProviders} from "@jamesbenrobb/app-shell-routing-adaptors";


export const appConfig: ApplicationConfig = {
  providers: [
    getJBRAppShellProviders(),
    getJBRAppShellDynamicRoutesNgxProviders(),
    getJBRDRAppProviders(
      'assets/route-config.json', {
        appName: 'Demo App'
      }
    )
  ]
};