我有一个启用了HTML5模式的Angular.js应用程序。
$location.Html5mode(true).hashbang("!");我想实现的是获得一些URL或<a>标签来执行正常的浏览行为,而不是使用HTML5历史API更改地址栏中的URL,并使用Angular控制器进行处理。
我有这个链接:
<a href='/auth/facebook'>Sign in with Facebook</a>
<a href='/auth/twitter'>Sign in with Twitter</a>
<a href='/auth/...'>Sign in with ...</a>我希望浏览器将用户重定向到/auth/...,这样用户就会被重定向到身份验证服务。
我有没有办法做到这一点?
发布于 2012-08-03 04:26:11
这是关闭所有深度链接的代码。它从rootElement禁用单击事件处理程序。
angular.module('myApp', [])
.run(['$location', '$rootElement', function ($location, $rootElement) {
$rootElement.off('click');
}]);https://stackoverflow.com/questions/11580004
复制相似问题