angular-http-throttler:AngularJS服务来限制$ http请求

时间:2021-05-26 05:55:35
【文件属性】:
文件名称:angular-http-throttler:AngularJS服务来限制$ http请求
文件大小:3KB
文件格式:ZIP
更新时间:2021-05-26 05:55:35
JavaScript 角http节流阀 AngularJS服务来限制$ http请求 需要AngularJS> = 1.1.5 受到angular-http-auth模块@ 启发 用法 将http-throttler模块作为依赖项添加到您的应用程序模块: var myAppModule = angular.module('MyApp', ['http-throttler']) 将httpThrottler服务添加到$ httpProvider.interceptors数组中 myAppModule.config(['$httpProvider', function($httpProvider) { $httpProvider.interceptors.push('httpThrottler'); }); 修改httpThrottler服务代码,设置最大请求数。 if reqCount >= 10
【文件预览】:
angular-http-throttler-master
----README.md(768B)
----service()
--------http-throttler.js(2KB)
--------http-throttler.coffee(1KB)

网友评论