0
我有一個關於範圍和承諾的小問題。 我在promise函數外聲明瞭wiz_ids,並且我希望在promise解決後再次訪問它。 我試圖使用bind()但沒有運氣。範圍訪問,當承諾在Angular UI中解決時
這是我的狀態:
state: 'wizard',
config: {
url: '/wizard',
templateUrl: 'app/partners/wizard/wizard.html',
controller: 'WizardController',
controllerAs: 'vm',
redirectTo: 'wizard.step1',
resolve: {
/* @ngInject */
promiseData: ['$window', '$location', 'WizardDataService', function ($window, $location, WizardDataService) {
var wiz_ids = {
'wiz_install_id': $location.search().install_id,
'wiz_instance_id': $location.search().instance_id
};
return WizardDataService.getWizardData(wiz_ids)
.then(function (response) {
// How do I access wiz_ids from here? //
return response.data;
});
}]
},
}
您能不能告訴'wizard.step1'狀態配置? – MiTa