如何在app router中使用带路径变量的regex mix
我有一个网址:如何在app router中使用带路径变量的regex mix,regex,polymer,Regex,Polymer,我有一个网址: <a href="/article/category/catalog/title"></a> 当我单击该url时,它应该匹配路由器,即,article matches article,category matches\w,catalog matches\w,title matches:title,因为我希望将title变量传递到另一个自定义元素以查询db,我如何实现这一点?您的正则表达式有问题吗,或者问题在于应用程序路由器?当路径模式为/^\/
<a href="/article/category/catalog/title"></a>
当我单击该url时,它应该匹配路由器,即,article matches article,category matches
\w
,catalog matches\w
,title matches:title
,因为我希望将title变量传递到另一个自定义元素以查询db,我如何实现这一点?您的正则表达式有问题吗,或者问题在于应用程序路由器
?当路径模式为/^\/article\/\w+\/\w+\/\w+//i时,它将匹配该url,但标题不能是传递给自定义元素的参数
<app-route path="/^\/article\/\w+\/\w+/\/:title/i" regex import="/pages/article/content-page.html"></app-route>