import { PreloadingStrategy, Route } from '@angular/router';
      import { Observable, of } from 'rxjs';
      
      export class PreloadSelectedModulesList implements PreloadingStrategy {
        preload(route: Route, load: Function): Observable<any> {
          return route.data && route.data['preload'] ? load() : of(null);
        }
      }
      Typescript language logo
      your recipe card header background

      Angular Preload OptIn

      Angular TypeScript Recipes

      The PreloadSelectedModulesList class implements the PreloadingStrategy interface. When the preload() method is called, the load() method will be executed if the route's data property has a preload value. Otherwise, the of() method will return null.

      Library: angular

      Shortcut: angular.preload.optin

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.