I'm trying to display a list of events after ajax callback using AngularJS
HTML:
<ul>
<li ng-repeat="event in events">{{ event.content }}</li>
</ul>
CONTROLLER:
app.controller("myctrl", function ($scope, mySrv) {
$scope.message = "";
$scope.events = mySrv.getEvents(26);
});
SERVICE:
app.factory('mySrv', function ($http) {
return {
getEvents: function (i_RequestID) {
$http({
method: 'POST',
url: '/Home/GetOptimizationResultEvents',
data: { RequestID: i_RequestID }
}).then(function successCallback(response) {
return response.data;
}, function errorCallback(response) {
// called asynchronously if an error occurs
// or server returns response with an error status.
});
}
}
});
Now there are no errors but i see no results.. what am i dooing wrong here ?
$http