如果我的 URL 是http://www.something.com/foo/bar/index.html?color=yellow&animal=rat
,看起来好像:
$location.path()
将返回foo/bar/index.html
$location.absUrl()
将返回http://www.something.com/foo/bar/index.html?color=yellow&animal=rat
$location.url()
将返回foo/bar/index.html?color=yellow&animal=rat
有什么函数会返回http://www.something.com/foo/bar/index.html
吗?
还是我必须自己使用协议、主机、端口等功能来构建它(或者我自己剥离查询参数)?