0
0
JRJose Romero
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 route.data && route.data['preload'] ? load() : of(null);
}
}