簡體   English   中英

Internet Explorer 11 Angularjs + NodeJS + Mongoose問題

[英]Internet explorer 11 Angularjs + NodeJS + Mongoose issue

我正在使用前端的Angularjs框架,后端的nodejs和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操作。 顯然,這是您的問題,因為您說的是當您重新加載瀏覽器時數據就在那里,因此問題不在於服務器端組件。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM