Created
August 4, 2014 03:53
-
-
Save loddit/2e97ea12a32f12d7427f to your computer and use it in GitHub Desktop.
avoid :option? route parse problem https://github.com/angular/angular.js/pull/8200/
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
| diff --git a/src/ngRoute/route.js b/src/ngRoute/route.js | |
| index 4ecc932..2041300 100644 | |
| --- a/src/ngRoute/route.js | |
| +++ b/src/ngRoute/route.js | |
| @@ -580,7 +580,7 @@ function $RouteProvider(){ | |
| if (i === 0) { | |
| result.push(segment); | |
| } else { | |
| - var segmentMatch = segment.match(/(\w+)(.*)/); | |
| + var segmentMatch = segment.match(/(\w+)\??(.*)/); | |
| var key = segmentMatch[1]; | |
| result.push(params[key]); | |
| result.push(segmentMatch[2] || ''); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment