0
모달에서 컨트롤러로 개체 (배열)를 전달하려고하는데이 오류가 발생합니다 :
배열을 반환하고 함수를 컨트롤러에 삽입했지만 함수가 작동하지 않는 함수로 resolve를 선언했습니다. 내가 도대체 뭘 잘못하고있는 겁니까? 다음은
은 모달 :
$scope.cercaClienteNomeCognome = function() {
if ($scope.nome == undefined){
var name = "";
} else name = angular.uppercase($scope.nome);
if ($scope.cognome == undefined){
var surname = "";
} else surname = angular.uppercase($scope.cognome);
var url = "servizi/getClienteNomeCognome?nomeCliente="+name+"&cognomeCliente="+surname;
$http.get(url)
.success(function(data, status, headers, config) {
if (data.length > 0) {
var modalInstance = $modal.open({
templateUrl: 'partials/modals/estensioneRicerca.html',
controller: 'estensioneRicercaController',
size : 'lg',
backdrop: 'static',
//keyboard: false,
resolve: {
returnArrayClienti: function() {
return data;
}
}
});
}
})
.error(function(data, status, headers, config) {
toaster.pop({
type : "Error",
title : "Ouh nou!",
body : "[RECUPERO CLIENTI] Errore durante il ritrovamento dei clienti"
});
});
};
그리고 이것은 컨트롤러 :
angular.module("itasAcquire.controllers")
.controller('estensioneRicercaController', ['$scope', '$rootScope', 'ConfigPropertiesService', 'toaster', '$log', '$http', 'returnArrayClienti',
function ($scope, $rootScope, ConfigPropertiesService, toaster, $log, $http, returnArrayClienti) {
$scope.mostraToasterTemporaneo = function() {
var clienti = returnArrayClienti;
var clienti = null;
if (clienti == undefined) {
toaster.pop({
type : "Success",
title : "WAIT!",
body : "Attenzione! Non e' stato selezionato alcun tipo documento!"
});
} else {
toaster.pop({
type : "Success",
title : "Congrats!",
body : "Il cliente è stato selezionato! (" + clienti.CODICE_FISCALE + ")"
});
}
};
}]);
모달 서비스를 사용하고 있습니까? 앵글 스트랩? 관습 하나? 그리고 주사 할 수없는 당신의 결심입니까? 너는 완전한 오류를 두지 않았다. – M21B8
컨트롤러에 $ 모달 주입이 누락되었다고 생각합니다. –
@ItsikMauyhas 나는 그것을 필요로하지 않는다. 컨트롤러에 모달을 사용하고 있지 않습니다.) –