나는 angularjs를 사용하여 프로젝트를 개발 중입니다. 웹 서비스 호출에 ngResource를 사용하고 있습니다. 내 응용 프로그램에는 매 30 초마다 실행되는 웹 서비스 호출이 있습니다. 이제는 어떤 상황에서 자동으로 실행되는 사용자 작업 및 웹 서비스에 의해 호출되는 웹 서비스가 서로 충돌하는 문제에 직면하고 있습니다. 나는 그것을 피하고 싶다. 내가 어떻게 해?Angularjs ngResource 여러 웹 서비스 호출 충돌
setInterval(function() {
$scope.getAllReports();
}
}, 30000);
reportService.factory('Reports', function ($resource, AppSettings) {
return $resource(AppSettings.api_url + 'reports/:reportId', {
reportId: '@reportId'
}, {
getReports: {
method: 'POST'
}
});
});
데모 모든