emilol / angular-crumbs

Angular Breadcrumb
https://emilol.github.io/angular-crumbs
MIT License
46 stars 46 forks source link

Entering directly via url ending up with bad router link in breadcrumb #5

Closed tonywr71 closed 6 years ago

tonywr71 commented 7 years ago

Ok, I believe I had solved this problem. You need to change:

 private createUrl(route: ActivatedRouteSnapshot) {
        return route.url.map(function (s) { return s.toString(); }).join('/');
 }

to

 private createUrl(route: ActivatedRouteSnapshot) {
        return route.url.map(s => s.path).join('/');
 }

otherwise it will perform a URL encode twice.

emilol commented 6 years ago

Nice catch! Feel free to submit a PR 😉