Angular Preload OptIn



    Jose Romero

    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

    import { PreloadingStrategy, Route } from '@angular/router';
    import { Observable, of } from 'rxjs';
    export class PreloadSelectedModulesList implements PreloadingStrategy {
      preload(route: Route, load: Function): Observable<any> {
        return &&['preload'] ? load() : of(null);
    Codiga Logo
    Codiga Hub
    • Rulesets
    • Playground
    • Snippets
    • Cookbooks
    • Security
    • Privacy Policy
    • Code Privacy
    • Terms of Service
    soc-2 icon

    We are SOC-2 Compliance Certified

    G2 high performer medal

    Codiga – All rights reserved 2022.