Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/angularjs/23.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 Angular ngRepeat无法从json对象提取值_Angularjs - Fatal编程技术网

Angularjs Angular ngRepeat无法从json对象提取值

Angularjs Angular ngRepeat无法从json对象提取值,angularjs,Angularjs,我有一个json文件“imgaeA”,它为控制器提供信息,其中aconsole.dir(data)输出“image D” 下面代码中的绑定无法生成item.name,只在“image B”处输出空行 但是,如果我将{{item.name}}更改为{{{item}},我会得到“image C” 我的json错误还是绑定表达式错误?谢谢 假人 {{item.name} menuItems不是http响应中返回的数据。这是http响应本身,您正在对其字段(数据、状态、状态文本等)进行迭代

我有一个json文件“imgaeA”,它为控制器提供信息,其中a
console.dir(data)
输出“image D”

下面代码中的绑定无法生成item.name,只在“image B”处输出空行

但是,如果我将{{item.name}}更改为{{{item}},我会得到“image C”

我的json错误还是绑定表达式错误?谢谢



  • 假人

    {{item.name}

menuItems
不是http响应中返回的数据。这是http响应本身,您正在对其字段(数据、状态、状态文本等)进行迭代

你可能有

$http.get(...).then(function(response) {
    $scope.menuItems = response;
});
而不是

$http.get(...).then(function(response) {
    $scope.menuItems = response.data;
});

发布控制器代码并获取ng控制器页面视图