How to add guid regex in angular ui-router state

后端 未结 3 1495
庸人自扰
庸人自扰 2021-01-03 15:49

I have this route



        
3条回答
  •  -上瘾入骨i
    2021-01-03 16:30

    There is a working plunker

    We can just provide regexp in the url definition:

    url: "/{id:(?:[a-fA-F0-9]{8}(?:-[a-fA-F0-9]{4}){3}-[a-fA-F0-9]{12})}",
    

    Read more about our options for url defintion:

    http://angular-ui.github.io/ui-router/site/#/api/ui.router.util.type:UrlMatcher

    small snippet:

    '{' name ':' regexp|type '}' - curly placeholder with regexp or type name. Should the regexp itself contain curly braces, they must be in matched pairs or escaped with a backslash.

提交回复
热议问题