3
我有模態一個角的項目,我想送多個(兩個)參數,當我關閉,問題是它給不確定的第二個參數,我的代碼如下發送多個參數當接近一個modalInstance
/*Modal controller*/
angular.module('assetModule')
.controller('assetModalLocationCtrl', ['locationRESTService','$modalInstance','$scope', '$q', assetModalLocationCtrl]);
function assetModalLocationCtrl (locationRESTService, $modalInstance, $scope, $q) {
this.ok = function() {
$scope.info.selected = selected ($scope.data.locations)
$modalInstance.close($scope.data.locations, $scope.info.selected);
};
}
/*Controller that invoke the modal*/
this.modalLocation = function modalLocation (size){
var modalInstance = $modal.open({
animation: this.animationsEnabled,
templateUrl: 'views/asset/assetLocationModal.html',
controller: 'assetModalLocationCtrl',
controllerAs: 'modalLocation',
size: size,
});
modalInstance.result.then(function (selectedItem, locationList) {
console.log(selectedItem);
console.log(locationList);
}, function() {
console.log('Modal dismissed at: ' + new Date());
});
}
總結的結果爲對象,並返回那。 –
發送帶有兩個字段的對象,每個對象的每個參數都是如何? – Avi