Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

fix(ngRoute): pipe preceding route param no longer masks ? or * operator #5920

Closed
wants to merge 1 commit into from

Conversation

caitp
Copy link
Contributor

@caitp caitp commented Jan 21, 2014

Before this change,

$routeProvider.when('/foo/:bar|?', { ... });

would not have the expected effect --- the parameter would not be optional, and the pipe would not be included in the parameter name.

Following this change, the presence of the pipe operator will typically cause an exception to be thrown due to the fact that the generated regexp is invalid.

The net result of this change is that ? and * operators will not be masked, and pipe operators will need to be removed, although it's unexpected that these are being used anywhere.

Before this change,

```js
$routeProvider.when('/foo/:bar|?', { ... });
```

would not have the expected effect --- the parameter would not be optional, and
the pipe would not be included in the parameter name.

Following this change, the presence of the pipe operator will typically cause an
exception to be thrown due to the fact that the generated regexp is invalid.

The net result of this change is that ? and * operators will not be masked, and
pipe operators will need to be removed, although it's unexpected that these are
being used anywhere.
@lrlopez
Copy link
Contributor

lrlopez commented Jan 21, 2014

Should this be tagged as a breaking change?

@caitp
Copy link
Contributor Author

caitp commented Jan 21, 2014

@lrlopez I mentioned that on the dev hangout, but the truth is I am highly skeptical that anybody is actually affected by this change, people don't tend to use pipes in their param names, I don't think. So the truth is, although this is a bug, it's probably not affecting anybody.

@lrlopez
Copy link
Contributor

lrlopez commented Jan 21, 2014

Thanks for the explanation.

@Pasvaz
Copy link

Pasvaz commented Jan 21, 2014

? and * are also affected by another bug with redirects, see #5746

@IgorMinar
Copy link
Contributor

lgtm please merge.

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

Successfully merging this pull request may close these issues.

4 participants