javascript - 重定向到在 angularjs 中不起作用的网页

标签 javascript c# html angularjs

当有人点击我的超链接时,我尝试重定向。 该页面的地址显示在地址栏中,但未加载。地址放置在标签{{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/

相关文章:

javascript - jQuery 怎么看起来既是一个对象又是一个对象调用的方法呢?

php - tinymce b.editor 为空,this.params 在 FF 上未定义

javascript - jquery中打印对象的值

c# - 如何在c#中测试条件运算符的右结合性

javascript - 经过另一个时隐藏固定元素

javascript - 使用node.js从url解析xml文件并循环获取其中的所有url

c# - 如何在 CodeBehind 的 DetailTable 中访问 FooterText (Telerik-RadGrid)?

c# - Windows 8 Metro TextBlock 动画

python - Selenium Python 无法在 ConnectWise 登录页面上选择元素

javascript - 为基于鼠标事件的动态div创建一个类