如果我的网址是http://www.something.com/foo/bar/index.html?color=yellow\u0026amp;animal=rat,好像是:
> $location.path()将返回foo / bar / index.html
> $location.absUrl()会返回http://www.something.com/foo/bar/index.html?color=yellow\u0026amp;animal=rat
> $location.url()将返回foo / bar / index.html?color = yellow& animal = rat
有什么功能将返回http://www.something.com/foo/bar/index.html?
据我所知,你必须自己构建它.不是你在问如何构造它,而是那些想知道的人:
var url = $location.absUrl().split('?')[0]