我的 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/