简体   繁体   English

绕过Angular URL路由

[英]Bypassing Angular URL routing

How do I bypass the routing provided by angular? 如何绕过angular提供的路由? For instance, in my angular routing settings, I have set $routeProvider.otherwise({redirectTo : '/someurl'}); 例如,在我的角度路由设置中,我设置了$routeProvider.otherwise({redirectTo : '/someurl'}); .

I want a certain request (generated by the user clicking a certain link in the HTML) to go to my webserver and not redirected to /someurl by Angular's routing. 我希望某个请求(由用户单击HTML中的某个链接生成)进入我的Web服务器,而不是通过Angular的路由重定向到/someurl How do I do this? 我该怎么做呢?

From the $location docs : $ 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> 示例: <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> 示例: <a href="http://angularjs.org/">link</a>

Links starting with '/' that lead to a different base path when base is defined. 以'/'开头的链接在定义base时导致不同的基本路径。 Example: <a href="/not-my-base/link">link</a> 示例: <a href="/not-my-base/link">link</a>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM