【发布时间】:2016-06-27 04:52:34
【问题描述】:
【问题讨论】:
【问题讨论】:
来自https://docs.angularjs.org/api/ng/service/$location:
// given url http://example.com/#/some/path?foo=bar&baz=xoxo var searchObject = $location.search(); // => {foo: 'bar', baz: 'xoxo'}
因此,如果您想获得 p 的价值,那就是
$location.search().p
【讨论】:
https://docs.angularjs.org/api/ng/service/$location
$location.search() 将为您提供一个包含名为“p”的键的对象
【讨论】: