我的角度应用程序位于目录&some; someApp'。对于某些状态网址,网址为http://example-domain/someApp/#/
的网址为http://example-domain/someApp/#/user/login
。http://example-domain/someApp/
。我在那里"棱角分明的方式"得到这个部分var redirectUri = $location.absUrl();
redirectUri = redirectUri.substr(0, redirectUri.indexOf('#'));
RecyclerView.Adapter.notifyItemChanged(int position)
答案 0 :(得分:4)
您需要使用:
location.origin + location.pathname
说网址是http://example.com/#/some/path?foo=bar&baz=xoxo
$location.protocol(); // will give: http
$location.host(); // will give: example.com
location.host // will give: example.com:8080
$location.port(); // will give: 8080
$location.path(); // will give: /some/path
$location.url(); // will give: /some/path?foo=bar&baz=xoxo
查看完整的detail