1

In an older version (0.4?) of angular ui-router we could do this...

url: '/:optional'

And everything worked fine (minus an extra backslash in the url). But when I upgraded to 1.0.5 I see...

Error: Param values not valid for state 'projects.list'. Invalid params: [ optional ]

I tried...

url: '/{mine:(?:/[^/]+)?}' too but it didn't work either

Is there a way I can do this in the 1.0 world?

1 Answer 1

2

Take a look at this answer to a similar question.

Also, as stated in the UI Router's documentation:

Route parameters with regular expressions can't be optional or greedy

Sign up to request clarification or add additional context in comments.

1 Comment

According to the same documentation re /:conditionId or /{conditionId} syntax; in the case ui-sref="contacts.detail({contactId: id})"; "The value for id can be anything in scope." Unless id is undefined!

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.