This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NgModule } from '@angular/core'; | |
import { RouterModule } from '@angular/router'; | |
@NgModule({ | |
imports: [ | |
RouterModule.forRoot( | |
[ | |
{ | |
path: 'books', | |
loadChildren: () => |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { NgModule } from '@angular/core'; | |
import { RouterModule } from '@angular/router'; | |
import { CustomPreloadingService } from '@razroo/common/ui/services'; | |
@NgModule({ | |
imports: [ | |
RouterModule.forRoot( | |
[ | |
// ...routes go here | |
], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { Subject } from 'rxjs'; | |
export class OnDemandPreloadOptions { | |
constructor(public routePath: string, public preload = true) {} | |
} | |
@Injectable({ | |
providedIn: 'root' | |
}) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { PreloadingStrategy, Route } from '@angular/router'; | |
import { EMPTY, Observable, of } from 'rxjs'; | |
import { mergeMap } from 'rxjs/operators'; | |
import { OnDemandPreloadOptions, OnDemandPreloadService } from './on-demand-preload.service'; | |
@Injectable({ providedIn: 'root', deps: [OnDemandPreloadService] }) | |
export class CustomPreloadingService implements PreloadingStrategy { | |
private preloadOnDemand$: Observable<OnDemandPreloadOptions>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Directive, ElementRef, HostListener } from '@angular/core'; | |
import { OnDemandPreloadService } from '@razroo/common/services'; | |
@Directive({ | |
selector: '[razrooPreload]' | |
}) | |
export class PreloadDirective { | |
constructor(private elementRef : ElementRef, | |
private onDemandPreloadService: OnDemandPreloadService) {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable } from '@angular/core'; | |
import { PreloadingStrategy, Route } from '@angular/router'; | |
import { EMPTY, Observable, of } from 'rxjs'; | |
import { mergeMap } from 'rxjs/operators'; | |
import { OnDemandPreloadOptions, OnDemandPreloadService } from './on-demand-preload.service'; | |
export declare var navigator; | |
@Injectable({ providedIn: 'root', deps: [OnDemandPreloadService] }) | |
export class CustomPreloadingService implements PreloadingStrategy { | |
private preloadOnDemand$: Observable<OnDemandPreloadOptions>; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Represents a collection of typography levels. | |
// Defaults come from https://material.io/guidelines/style/typography.html | |
// Note: The spec doesn't mention letter spacing. The values here come from | |
// eyeballing it until it looked exactly like the spec examples. | |
@function mat-typography-config( | |
$font-family: 'Roboto, "Helvetica Neue", sans-serif', | |
// Large, one-off header, usually at the top of the page (e.g. a hero header). | |
$display-4: mat-typography-level(112px, 112px, 300, $letter-spacing: -0.05em), | |
// Large, one-off header, usually at the top of the page (e.g. a hero header). | |
$display-3: mat-typography-level(56px, 56px, 400, $letter-spacing: -0.02em), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin mat-base-typography($config, $selector: '.mat-typography') { | |
.mat-h1, .mat-headline, #{$selector} h1 { | |
@include mat-typography-level-to-styles($config, headline); | |
margin: 0 0 16px; | |
} | |
.mat-h2, .mat-title, #{$selector} h2 { | |
@include mat-typography-level-to-styles($config, title); | |
margin: 0 0 16px; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin mat-base-typography($config, $selector: '.mat-typography') { | |
.mat-h1, .mat-headline, #{$selector} h1 { | |
@include mat-typography-level-to-styles($config, headline); | |
margin: 0 0 16px; | |
} | |
.mat-h2, .mat-title, #{$selector} h2 { | |
@include mat-typography-level-to-styles($config, title); | |
margin: 0 0 16px; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Note: the spec doesn't have anything that would correspond to h5 and h6, but we add these for | |
// consistency. The font sizes come from the Chrome user agent styles which have h5 at 0.83em | |
// and h6 at 0.67em. | |
.mat-h5, #{$selector} h5 { | |
@include mat-typography-font-shorthand( | |
// calc is used here to support css variables | |
calc(#{mat-font-size($config, body-1)} * 0.83), | |
mat-font-weight($config, body-1), | |
mat-line-height($config, body-1), | |
mat-font-family($config, body-1) |