1

I have a route

.when('/calculator/c_:clientId/t_:type/:assetId',.....)

I want make /t_:type/:assetId optional

My desired urls could be

/calculator/c_100    
/calculator/c_100/t_value1
/calculator/c_100/t_value2/10

Is there any way to do this. Using ? can make only one optional and also not the constant part like c_, t_

4

1 回答 1

3

你只需要添加一个“?” 给你路由定义中的参数

.when('/calculator/c_:clientId/t_:type/:assetId?',.....)
于 2014-08-06T14:05:21.503 回答