我正在使用Angularjs框架在前端开发我的网站,nodejs backend和mongoose将我的数据持续到mongoDB数据库中。
在Firefox RS v.24和Chrome中,一切都可以,当我将用户添加到数据库中时,该新用户将自动显示到我的列表网格中。
,但是在IE 11中,直到我关闭浏览器并将其打开后才。
当我添加一个新的配置文件时,我会在控制器中进行以下操作:
$scope.AddProfil = function() {
$http.post('/ajouterProfils', $scope.profil)
.success(function(data) {
$scope.profilFlag = data; /*unit tests*/
$scope.lastDocId = data._id;
$scope.ajouterProfilTag($scope.lastDocId);
$scope.profil = {};
$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);
});
};
在我的dao中,我有一个:
/**
* Add a profile
*/
exports.createProfile = function(req, res) {
var profile = new Profil(req.body);
profile.save(function(err) {
if (err) {
return res.send('users/signup', {
errors: err.errors,
profile: profile
});
} else {
res.jsonp(profile);
}
});
};
有什么想法吗?反馈 ?
如注释,使用指令和数据绑定而不是DOM操纵。显然,这是您的问题,因为您说当您重新加载浏览器时,数据就在那里,因此问题不是服务器端组件。