当前位置:/AngularJS API/ngRoute/服务(service)/$routeParams

$routeParams服务运行检索当前路由的参数集。


依赖

$route

实例

// Given:
// URL: http://server.com/index.html#/Chapter/1/Section/2?search=moby
// Route: /Chapter/:chapterId/Section/:sectionId
//
// Then
$routeParams ==> {chapterId:'1', sectionId:'2', search:'moby'}