I have the following code:
angular.module('admin')
.factory('gridService',
['$resource', 'gridSelectService', 'localStorageService',
function ($resource, gridSelectService, localStorageService) {
var factory = {
gridSetup: function ($scope) {
$scope.editRow = function (row, entityType) {
window.setTimeout(function () {
window.setInterval(function () {
submitItem($scope, $scope.modal.data);
}, 1 * 60 * 1000);
submitItem($scope, $scope.modal.data);
}, 1 * 60 * 1000);
}
submitItem: function ($scope, formData) {
}
}
}
I want to call the submitItem function from inside of the window.setTimeout and the setInterval but it does not recognize the function. How can I call it ? I tried putting gridService.submitItem but that does not work either.