Javascript AngularJS路由参数
Javascript AngularJS路由参数,javascript,angularjs,angularjs-routing,Javascript,Angularjs,Angularjs Routing,friendID=1234 $route.when( "/friends/:friendID/raw", { event: "friends.view" } ); 当我运行上述程序时,Chrome开发工具中的URL显示尝试的URL是http://domain.com/friends/raw?0=1&1=2&2=3&3=4 有没有办法让它以http://domain.com/friends/1234/raw仅凭这段代码很难判断这里发生了什么。您可以发布JS
friendID=1234代码>
$route.when(
"/friends/:friendID/raw",
{
event: "friends.view"
}
);
当我运行上述程序时,Chrome开发工具中的URL显示尝试的URL是http://domain.com/friends/raw?0=1&1=2&2=3&3=4
有没有办法让它以http://domain.com/friends/1234/raw
仅凭这段代码很难判断这里发生了什么。您可以发布JSON对象的值吗?乍一看,您的对象似乎正在传递多个值。您可以尝试将其值设置为1234,然后查看它是否正确通过