zoukankan      html  css  js  c++  java
  • One difference between AngularJS' $location and window.location

    Recenently, I encountered a problem. 

    Client side code is:

    $http({
    url: "/api/runtimelicense"
    , method: "GET"
    })
    .success(function (data) {
    window.location('#/search');
    })
    .error(function () {
    });

    Server side code is:

    DbContext_context = GetContext(); // Just get dbcontexnt.

    _context.MyDBSet.Where(s => s.ID == myID).ToList(); // When this request is from IE,it always throw exception with message "The connection was not closed. The connection's current state is open."; but if this request is from Chrome, all are ok.

    At beginning, I felt very strange, as I know, browser should not impact server side by the same http request. I open Fiddler to see, there is an AngularJs digest error in IE, this error causes another request, it means there are two same http request to submit. I googled this question, but got nothing. I just repalce "window.location('#/search');" with "$location.path('/search');" , this issue is solved. Now, I still cannot know the details clearly. So, remain 2 questions:

    1) Why does IE Angular digest exception?

    2) Why does exception can cause another request?

  • 相关阅读:
    平台总体技术架构
    防控激活
    dse测试说明
    设置内核tcp连接数
    删除topic的尝试
    用Jmeter进行接口压力测试的步骤
    性能测试
    配置文件的修改
    mysql 监控
    电子栅栏sql和接口查询
  • 原文地址:https://www.cnblogs.com/xixifusigao/p/3954061.html
Copyright © 2011-2022 走看看