我有这条路线:
Path.map("/(:page_1)(/:page_2)/").to(funct);
并且不匹配
/projects/index2/
它匹配/anything
但不匹配/anything/anything
有什么想法吗?
答案 0 :(得分:2)
尝试仅在括号中包装第二个可选值。所以,而不是做:
Path.map("#/(:page_1)(/:page_2)/").to(funct);
尝试:
Path.map("#/:page_1(/:page_2)").to(funct);
查看这个jsfiddle:http://jsfiddle.net/Jkeq9/1/