I am currently working on developing my website using the AngularJS framework for the front end, Node.js for the backend, and Mongoose to store data in a MongoDB database.
Everything works fine in Firefox RS v.24 and Chrome - when I add a new user to the database, they are automatically displayed in my list grid.
However, in IE 11, the new user is not shown until I close the browser and reopen it.
When adding a new profile, I follow these steps in my Controller:
$scope.AddProfile = function() {
$http.post('/addProfiles', $scope.profile)
.success(function(data) {
$scope.profileFlag = data; /*unit tests*/
$scope.lastDocId = data._id;
$scope.addProfileTag($scope.lastDocId);
$scope.profile = {};
$scope.tagStyles.length = 0;
$scope.tagStyles = [];
$scope.colorList = {};
angular.element($('.shown-text-add').text($('.shown-text-add').text()));
angular.element($('.shown-text-add').css('font-family', '');
angular.element($('.shown-text-add').css('font-size', '');
angular.element($('.shown-text-add').css('line-height', '');
angular.element($('.shown-text-add').css('font-weight', '');
setTimeout( function(){$('#addPanel').show();} );
setTimeout( function(){$('#addPanel').fadeOut();}, 2500);
});
};
In my DAO, I have the following code:
/**
* Add a profile
*/
exports.createProfile = function(req, res) {
var profile = new Profile(req.body);
profile.save(function(err) {
if (err) {
return res.send('users/signup', {
errors: err.errors,
profile: profile
});
} else {
res.jsonp(profile);
}
});
};
Any thoughts or feedback?