AngularJS - 干线 - 如何匹配星号(*)为路径 [英] AngularJS - Route - How to match star (*) as a path
本文介绍了AngularJS - 干线 - 如何匹配星号(*)为路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在做一个资源查看器应用程序,但问题是,我试图以匹配时(/ /:resourceUrl)。
I'm making a resource viewer app, but the problem is that i tried to match when("/!/:resourceUrl")
.
如果资源URL是像 /路径
,但我怎么能做出像一个 /路径/要/的它工作正常/资源
。结果
我不知道会有多大的路径走,所以我不能做。当(/ /:路径1 /:PATH2 /:path3时)。
It works fine if the resource url is something like /path
, but how can I make something like a /path/to/the/resource
.
I don't know how much paths will it take, so I can't do .when("/!/:path1/:path2/:path3")
.
任何想法?
推荐答案
截至目前,AngularJS不支持正恩pressions的路线。
As of now, AngularJS doesn't support regular expressions in routes.
检查这些链接: https://github.com/angular/angular.js/问题/ 918 , https://github.com/angular/angular.js /拉/ 972
这篇关于AngularJS - 干线 - 如何匹配星号(*)为路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文