当有人点击我的超链接时,我尝试重定向。
该页面的地址显示在地址栏中,但未加载。地址放置在标签{{tag}}
中。标签使用 href
设置值。
最佳答案
This Will Successfully Redirect as there is no # hash in url
$scope.onButtonClick = function () {
$location.url('/controller2?dataId='+33);
}
This Will not Redirect Due To # hash in Url
So Add $location.reload();
It Will Change Url + navigate your page
$scope.onButtonClick = function () {
$location.url('#/controller2?dataId='+33);
$location.reload();
}
关于javascript - 重定向到在 angularjs 中不起作用的网页,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30435702/