如何绕过angular提供的路由?例如,在我的 Angular 路由设置中,我设置了 $routeProvider.otherwise({redirectTo : '/someurl'});
。
我希望某个请求(由用户单击 HTML 中的某个链接生成)转到我的网络服务器,而不是通过 Angular 的路由重定向到 /someurl
。我该怎么做?
最佳答案
来自$location docs :
In cases like the following, links are not rewritten; instead, the browser will perform a full page reload to the original link.
Links that contain target element. Example:
<a href="/ext/link?a=b" target="_self">link</a>
Absolute links that go to a different domain. Example:
<a href="http://angularjs.org/">link</a>
Links starting with '/' that lead to a different base path when base is defined. Example:
<a href="/not-my-base/link">link</a>
关于javascript - 绕过 Angular URL 路由,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20657593/