1
我有一個angular問題。我有這樣的代碼在我的模板:當ui-sref改變時,href不會刷新
<select class="form-control"
ng-model="hiveReports.reportSelected"
ng-options="link for link in hiveReports.reportsLink"
ui-sref="dashboard.hive-reports.{{hiveReports.reportSelected}}">
</select>
和後面的代碼是這樣的:
.config(['$stateProvider', function ($stateProvider) {
$stateProvider
.state('dashboard.hive-reports', {
url: '/hive-reports',
template: require('./hiveReports.tmpl.html'),
abstract: true,
controller: 'HiveReportsCtrl as hiveReports'
});
}])
.controller('HiveReportsCtrl', [
'$rootScope',
'$state',
function ($rootScope,
$state) {
var controller = this;
controller.reportSelected = 'transactions';
controller.reportsLink = ['transactions','devices'];
}])
它創建一個選擇和切換的狀態下,當我選擇一個選項。
在另一種模板,它工作正常,但我有這樣的
<select class="form-control"
ng-model="hiveProfile.selectedProfile "
ng-options="profile.id as profile.name for profile in hiveProfile.profile"
ui-sref="dashboard.hive-profile.profile({profileId:hiveProfile.selectedProfile })">
</select>
鏈接參數我覺得dashboard.hive-project.profile()觸發其刷新HREF但沒有PARAM事件,它不起作用。我嘗試了很多可能性,但沒有任何工作。試圖像
ui-sref="dashboard.hive-reports.{{hiveReports.reportSelected}}()">
或
ui-sref="dashboard.hive-reports.{{hiveReports.reportSelected}}({})">
任何想法,以解決我的問題的角度指令觸發一個事件?