javascript - 使用 angularJs 重定向到其他项目

标签 javascript angularjs backbone.js

我的 URL 是这样的:http://localhost:3000/family/#/savings/subscribe/123456

在此页面中,我想单击一个按钮将我重定向到另一个使用 backbone JS 制作的项目的其他页面 我尝试使用 href- 和 ng-href 添加所需的 URI http://localhost:3000/admin#exemption :但它总是将我重定向到 http://localhost:3000/家庭/#/admin#exemption

   angular.module('app', ['ng', 'ngRoute', 'ui.bootstrap', 'angularMoment', 'chart.js'])
 .config(fac['$routeProvider', function ($routeProvider) {
    $routeProvider
  .when('/index', {
        templateUrl: '/family/index',
        controller: 'IndexCtrl'
      })
  .when('/family/exemption', {
        templateUrl: 'exemption-search-view'
      })

当我提供所需页面的模板时,我获得了 html View 但 URI:http://localhost:3000/family/#/admin#exemption

最佳答案

我不确定是否理解这个问题,但是如果你想避免 Angular 路由拦截,你应该添加你的 anchor target="_self"。

<a ng-href="{{vm.logoutUrl}}" target="_self">Bye!</a>

关于javascript - 使用 angularJs 重定向到其他项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40590088/

相关文章:

javascript - !this.get 在 Backbone todo MVC 应用程序中的含义

javascript - Angularjs按范围变量划分失败

javascript - 函数完全打印

html - 如何以编程方式创建 DragEvent?

javascript - 如何在 react 中设置按钮在特定条件下禁用?

javascript - Backbone : Adding a model to Collection and render a View

javascript - Requirejs + Backbone 未捕获类型错误 : Cannot read property 'Model' of undefined

javascript - 在javascript中移动对象内的元素

javascript - jQuery CSS 方法重写 :hover properties

javascript - 映射数据呈现多个 Material-UI Dialog 组件