我有一个问题。我UI-ROUTER
在我的应用程序中使用 Angular.js。我在下面解释我的代码。
<li ui-sref-active="active"><a ui-sref="product.eVouchers.dashboard">Dashboard</a></li>
上面的 li 标签在输出下面生成
<a ui-sref="product.eVouchers.dashboard" href="/product/eVoucher/dashboard">Dashboard</a>
由于我尚未在 href 参数中删除 hash(#) 标记#
,<a ui-sref="product.eVouchers.dashboard" href="#/product/eVoucher/dashboard">Dashboard</a>
因此只有当我试图通过右键单击在新选项卡中打开同一页面时,该页面才会出现。
我在下面解释我的路线文件。
var Admin=angular.module('medilink',['ui.router','ngMessages','ngFileUpload','ui.bootstrap','720kb.datepicker']);
Admin.run(function($rootScope, $state) {
$rootScope.$state = $state;
});
Admin.config(function($stateProvider, $urlRouterProvider,$locationProvider) {
$urlRouterProvider.otherwise('/product');
$stateProvider
.state('product', {
url: '/product',
templateUrl: 'productview/product.html',
controller: 'productController'
})
.state('product.eVouchers',{
url:'/eVoucher',
templateUrl:'VoucherView/mas.html',
controller: 'eVoucherController'
})
.state('product.eVouchers.dashboard',{
url:'/dashboard',
templateUrl:'VoucherView/dashboard.html',
controller: 'dashboardController'
})
$locationProvider.html5Mode({
enabled: false
});
});
在这里,我需要将#
标签作为 href 参数与生成的 html 输出中的其他值一起使用。请帮我解决这个问题。