Ich habe ein Click-Ereignis, um die AngularJS-Funktion aufzurufen, die die Daten aus SQL abruft und zum Ajax-Aufruf zurückkehrt. Mein Problem ist, die Daten, die auf dem zweiten nur bindet mit ng-repeat abgerufen klicken event.Here mein Code,Datenbindung funktioniert nur beim zweiten Klick-Ereignis
`
(function (app) {
app.controller("OnvioController", function ($scope,$http, OnvioService) {
$scope.retData = [];
$scope.getResult = function() {
var serviceURL =window.location.origin+ '/Datafetching/dataFetch';
$.ajax({
type: "POST",
url: serviceURL,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(data, status) {
$scope.retData = data;
},
error: function (status) {
}
});
}
});
}(angular.module("OnvioModule")));
`
hast du '$ http.get' ausprobiert? –