init commit

This commit is contained in:
zhouyuejun
2018-10-26 11:33:25 +08:00
commit bec3bb9137
106 changed files with 29628 additions and 0 deletions
+12
View File
@@ -0,0 +1,12 @@
import { PreloadingStrategy, Route } from '@angular/router'
import { Observable, of } from 'rxjs'
/**
* 预加载策略
*/
export class SelectivePreloadingStrategy implements PreloadingStrategy {
preload(route: Route, load: Function): Observable<any> {
//默认进行加载,当配置了preload=false时不预加载
return route.data && route.data.preload === false ? of(null) : load();
}
}