I am developing a simple user management system using angularjs. It just adds, updates and removes the view of the application. I am using spring -mvc in the background to get a JSON response. Everything works fine in Firefox, Chrome and Safari, but IE .. !!!!
I have one page that lists all users. For the first time, it will work perfectly in IE9 / 10, but any update made for any user will not be displayed in the view (using IE).
I can not understand what is happening. I think IE9 / 10 will also cache json data, and each time a user list page is called, it associates this cached data with the page.
Is it possible to make IE9 / 10 forget the downloaded data?
Angular to access the web service:
angular.module("user.service", ["ngResource"]). factory('User', function($resource, $rootScope) { var User = $resource( $rootScope.apipath + 'users/:userId', {userId: '@id'}, {update: {method: 'PUT'}} ); User.prototype.isNew = function() { return (typeof(this.id) === 'undefined'); }; return User; });
UserList Controler:
function UserListController($scope, User) { $scope.users = User.query(); }
UserList Tamplate:
<h2><msg key="users"></msg><a class="btn btn-primary pull-right" href="#/users/new"><i class="icon-plus-sign icon-white"></i><msg key="addnew"></msg></a></h2> <table class="table table-striped"> <tr> <th><msg key="username"></msg></th> <th><msg key="name"></msg></th> <th></th> </tr> <tr ng-repeat="user in users"> <td>{{user.userId}}</td> <td>{{user.contact.firstName}} {{user.contact.lastName}}</td> <td> <div class="pull-right"> <a class="btn btn-info" href="#/users/{{user.id}}"> <i class="icon-pencil icon-white"></i><msg key="edit"></msg> </a> </div> </td> </tr> </table>
source share