import { NgModule , ModuleWithProviders } from '@angular/core' ; import { OfflineProvidersConfig , OFFLINE_ROUTE_OFFLINE , OFFLINE_ROUTE_UNAVAILABLE , OFFLINE_GUARDS_REDIRECT } from './tokens' ; /**
 * This module does not contain anything, it's only useful to provide options via `.forRoot()`.
 */ @ NgModule ( ) export class OfflineModule { example static forRoot ( config ) { return { ngModule : OfflineModule , providers : [ config . routeOffline ? { provide : OFFLINE_ROUTE_OFFLINE , useValue : config . routeOffline } : [ ] , config . routeUnavailable ? { provide : OFFLINE_ROUTE_UNAVAILABLE , useValue : config . routeUnavailable } : [ ] , config . guardsRedirect === false ? { provide : OFFLINE_GUARDS_REDIRECT , useValue : false } : [ ] , ] , } ; } }