在這裏,看起來你的params
是一個關聯數組。
可以此鏈接查看根據這個答案https://stackoverflow.com/a/29792020/1907391
在0.2.13版本christopherthielen
.state('foo', {
url: '/foo/:param1?param2',
params: { param3: null } // null is the default value
});
$state.go('foo', { param1: 'bar', param2: 'baz', param3: { id: 35, name: 'what' } });
$stateParams in 'foo' is now { param1: 'bar', param2: 'baz', param3: { id: 35, name: 'what' } }
而且也,你應該能夠物體進入$狀態https://github.com/angular-ui/ui-router/issues/983 評論。去,
$state.go('myState', {myParam: {some: 'thing'}})
$stateProvider.state('myState', {
url: '/myState/{myParam:json}',
params: {myParam: null}, ...
and then access the parameter in your controller.
$stateParams.myParam;