Below is the code snippet I am working with:
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 am trying to call the submitItem function from inside the window.setTimeout and setInterval, but it's not recognizing the function. How can I properly call it? I have tried using gridService.submitItem but that didn't work either.