I have had a problem with IE caching everything, so if i switched user, i would still see data from the old user which is not logged in anymore.
I tried this solution (found at : Angular IE Caching issue for $http ), and it worked but now my directive can't GET the template it needs, how can i get both things to work ?
code:
app.config(['$httpProvider', function ($httpProvider) {
//initialize get if not there
if (!$httpProvider.defaults.headers.get) {
$httpProvider.defaults.headers.get = {};
}
console.log($httpProvider.defaults.headers.get['If-Modified-Since']);
//disable IE ajax request caching
$httpProvider.defaults.headers.get['If-Modified-Since'] = '0';
}]);
My directive:
app.directive('commentsContainer', function (commentResource, signalRService) {
return {
restrict: 'EAC',
templateUrl: '/Templates/Directives/_Comments.html',
link: function ($scope) {
//CODE
}
}
EDIT! it get an error no matter which browser, here is the one from chrome :
GET http://localhost:58991/Templates/Directives/_Comments.html 400 (Bad Request)
Error: [$compile:tpload] Failed to load template: /Templates/Directives/_Comments.html
Without the angular snippit for caching, it works fine..
Hope you can help!