Created
May 19, 2019 13:15
-
-
Save daretodave/ddcaecf51431fd1fbf3e5a66bbdf4f67 to your computer and use it in GitHub Desktop.
This file contains 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 {DefaultRouteReuseStrategy} from '@angular/router/src/router'; | |
import {ActivatedRouteSnapshot} from '@angular/router'; | |
export class CustomRouteReuseStrategy extends DefaultRouteReuseStrategy { | |
shouldReuseRoute(future: ActivatedRouteSnapshot, curr: ActivatedRouteSnapshot): boolean { | |
let name = future.component && (<any>future.component).name; | |
return super.shouldReuseRoute(future, curr) && name !== 'ThisWouldBeAComponentThatShouldReload'; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment