Skip to content

Commit ad575fc

Browse files
committed
use placeholders when generating paths with missing params
1 parent 5dfa476 commit ad575fc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/route-recognizer.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ DynamicSegment.prototype = {
5959
},
6060

6161
generate: function(params) {
62-
return params[this.name];
62+
return params[this.name] || ":" + this.name;
6363
}
6464
};
6565

@@ -74,7 +74,7 @@ StarSegment.prototype = {
7474
},
7575

7676
generate: function(params) {
77-
return params[this.name];
77+
return params[this.name] || ":" + this.name;
7878
}
7979
};
8080

0 commit comments

Comments
 (0)