0
下面是我的代碼段,其中我試圖使用uimodal來顯示用戶詳細信息以及其他詳細信息。無法將API響應傳遞給uimodal
我無法將響應數據綁定到uimodal,請幫助解決此問題。
$scope.selectedUserData = '';
$scope.edituser = function (user) {
usereditService.resp(size.userid, function (response) {
if (response != false) {
console.log(response[0]);//Specific user details object from API
selectedUserData = response[0];
}
else {
console.log('no user found');
}
});
$scope.modalInstance = $uibModal.open({
animation: false,
backdrop: 'static',
templateUrl: '/_views/_editUser.html',
controller: 'userController',
size: size,
resolve: {
selectedData: function() {
return $scope.selectedUserData;
}
},
controller: function($scope, selectedData) {
$scope.editobj = selectedData;
}
});
modalInstance.result.then(function (response) {
$scope.selected = response;
}, function() {
$log.info('Modal dismissed at: ' + new Date());
});
};
你可以添加'usereditService.resp'代碼嗎? –