Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/google-chrome/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/user-interface/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
AngularJS ng在firefox上重复工作,但不在chrome和IE上重复工作?_Angularjs_Google Chrome_Firefox - Fatal编程技术网

AngularJS ng在firefox上重复工作,但不在chrome和IE上重复工作?

AngularJS ng在firefox上重复工作,但不在chrome和IE上重复工作?,angularjs,google-chrome,firefox,Angularjs,Google Chrome,Firefox,我用$http.get加载了一些数据 $http.get('toDOTasks.json') .success(function (response) { $scope.tasks = response; }); 那么我有: <div ng-repeat="task in tasks| filter:search | orderBy: orderType() | limitTo: show" class="row"> 它在f

我用$http.get加载了一些数据

$http.get('toDOTasks.json')
        .success(function (response) {
            $scope.tasks = response;
        });
那么我有:

<div ng-repeat="task in tasks| filter:search | orderBy: orderType() | limitTo: show" class="row">

它在firefox中工作,但当我尝试chorome或IE时,它不工作,会有什么问题?

您使用的是什么版本的angular。
在这种情况下,您可以使用1.2版进行尝试,因为if更兼容。请参阅angular docs

您的控制台是否出现错误?是的,我得到:XMLHttpRequest无法加载file:///....JSON/toDoTasks.json. 跨源请求仅支持协议方案:http、数据、chrome、chrome扩展、https、chrome扩展资源。在ChromeI上,我使用1.4.6,但我尝试了1.2.29,它仍然是一样的,它只在Firefox上加载json,json在本地加载到项目中的同一目录中,这可能是问题吗?您是否从服务器访问它,如:localhost/index.html?或者只是使用file://?是的,这似乎是问题所在,我是从file://运行它的,我尝试使用localhost,它成功了,谢谢!你有没有找到一种方法在Chrome中解决这个问题?ng show命令的sum或count的angularjs或其他ng在Chrome中同时重复有没有任何限制?