Created
May 29, 2018 14:13
-
-
Save Frelseren/a954e35300931c3d0a7010643da8ac11 to your computer and use it in GitHub Desktop.
A custom url serializer for Angular Router to support escape characters
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 { UrlSerializer, UrlTree, DefaultUrlSerializer } from '@angular/router'; | |
export class CustomUrlSerializer implements UrlSerializer { | |
parse(url: any): UrlTree { | |
const dus = new DefaultUrlSerializer(); | |
return dus.parse(unescape(url)); | |
} | |
serialize(tree: UrlTree): any { | |
const dus = new DefaultUrlSerializer(); | |
return dus.serialize(tree); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment