![httpProvider httpProvider]()
本文介绍了当我使用角度js时如何解决页面缓存问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 当我使用带有MVC的anguler js时,我正面临网页浏览器缓存问题。 没有变化反映因为页面已经被缓存所以它非常恼火打开一个私人窗户看看变化。 请帮忙。 我有什么试过:Hi,I am facing web browser cache problem when I am using anguler js with MVC.No changes reflect because page is already cached so its very irritating to open a private window to see the changes.Please help.What I have tried:myModule.config(['$httpProvider', function ($httpProvider) { $httpProvider.interceptors.push('noCacheInterceptor');}]).factory('noCacheInterceptor', function () { return { request: function (config) { console.log(config.method); console.log(config.url); if (config.method == 'GET') { var separator = config.url.indexOf('?') === -1 ? '?' : '&'; config.url = config.url + separator + 'noCache=' + new Date().getTime(); } console.log(config.method); console.log(config.url); return config; } };});推荐答案 这篇关于当我使用角度js时如何解决页面缓存问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云! 08-28 16:21