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_

1 Answer 1

3

you just need to add a "?" to you parameter in the route definition

.when('/calculator/c_:clientId/t_:type/:assetId?',.....)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.