Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems with simple Regex #80

Closed
janhartmann opened this issue Aug 14, 2017 · 1 comment
Closed

Problems with simple Regex #80

janhartmann opened this issue Aug 14, 2017 · 1 comment

Comments

@janhartmann
Copy link

janhartmann commented Aug 14, 2017

Hi and thanks for this piece of software!

I have a route like: /profile/424021007778888 and a setup like this

this.breadcrumb.addFriendlyNameForRoute("/profile", "Profile");
this.breadcrumb.addCallbackForRouteRegex(new RegExp("\/profile\/\d+$").toString(), s => this.profile.name[0].value);

Which correctly displays "Profile", but the last part of the URL (the number) is not converted to my profile name? According to https://regex101.com/r/UOYPE6/1 this should work? :-)

What am I missing here?

@janhartmann
Copy link
Author

Apperently, it can be fixed with: this.breadcrumb.addCallbackForRouteRegex('/profile/[0-9]', id => this.profile.name[0].value);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant