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

Router: Unable to configure child routes when using regex route #7602

Closed
brandonroberts opened this issue Mar 14, 2016 · 4 comments
Closed
Labels
feature Issue that requests a new feature

Comments

@brandonroberts
Copy link
Contributor

Note: for support questions, please use one of these channels: https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question. This repository's issues are reserved for feature requests and bug reports.

  • *I'm submitting a ... *
    [x] bug report
    [ ] feature request
    [ ] support request => Please do not submit support request here, see note at the top of this template.
  • Do you want to request a feature or report a bug?

Bug

  • What is the current behavior?

When trying to use regex route matching, the child routes for the route are not configured.

http://plnkr.co/edit/FmmaTD?p=preview

  • What is the expected behavior?

I expect to provide the regex/serializer and configure child routes under the parent route.

  • What is the motivation / use case for changing the behavior?

I should be able to define a parent route with regex/serializer and add use that route to group child routes under it.

  • Please tell us about your environment:
  • Angular version: 2.0.0-beta.X
  • Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
  • Language: [all | TypeScript X.X | ES6/7 | ES5 | Dart]

Angular 2.0.0-beta.9
Browser: all
Language: TypeScript

  • Other information (e.g. detailed explanation, stacktraces, related issues, suggestions how to fix, links for us to have context, eg. stackoverflow, gitter, etc)

Open up the console after running the plunker to see the error. Sample stack trace

angular2.dev.js:23597 ORIGINAL EXCEPTION: Child routes are not allowed for "undefined". Use "..." on the parent's route path.
@btford
Copy link
Contributor

btford commented Mar 23, 2016

How do you define what part of the regex goes on to the child to be matched?

@btford btford added feature Issue that requests a new feature comp: router labels Mar 23, 2016
@btford
Copy link
Contributor

btford commented Mar 23, 2016

I agree this should be supported, but I think we need to extend the API to explicitly show how the regex capturing interacts with children. I see it as a missing feature rather than a bug.

@brandonroberts
Copy link
Contributor Author

I think the generated URL from the serializer would still contain the ellipsis to indicate that the route was not terminal and the ellipsis would be stripped when the URL is generated. Explicitly marking a regex route with a terminal conifg property would be another option, although a lot less dynamic.

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Issue that requests a new feature
Projects
None yet
Development

No branches or pull requests

2 participants