Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/79.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
Html 为什么ng repeat中没有显示任何内容?_Html_Angularjs_Json - Fatal编程技术网

Html 为什么ng repeat中没有显示任何内容?

Html 为什么ng repeat中没有显示任何内容?,html,angularjs,json,Html,Angularjs,Json,现在我有返回arraylist的spring service。。我做了一个allert来测试controller中返回的数组,它成功地显示为JSON对象。。但在Html文件中的ng repeat中没有显示任何内容 HTML文件: 学生页 文件。写(“”); {{x.name} =>{{x.score} html中的一些更改及其对我的影响很好(您也不必再次使用ng app): HTML: <body ng-controller="mainCtrl" class="container" s

现在我有返回arraylist的spring service。。我做了一个allert来测试controller中返回的数组,它成功地显示为JSON对象。。但在Html文件中的ng repeat中没有显示任何内容

HTML文件:


学生页
文件。写(“”);
{{x.name}
=>{{x.score}

html中的一些更改及其对我的影响很好(您也不必再次使用
ng app
):

HTML:

<body ng-controller="mainCtrl" class="container" style="padding-top:30px">
    <table>
      <tr ng-repeat="x in sharedData">
        <td> {{x.name}} </td>
        <td> => {{x.score}} </td>
      </tr>
    </table>
  </body>
angular.module('app', []);

angular.module('app').controller('mainCtrl', function($scope) {
  $scope.sharedData = [{
    name: 'Subtraction',
    score: 1500
  }]

});

下面是正在工作的Plnkr:

html中的一些更改及其对我的工作良好(您也不必再次使用
ng app
):

HTML:

<body ng-controller="mainCtrl" class="container" style="padding-top:30px">
    <table>
      <tr ng-repeat="x in sharedData">
        <td> {{x.name}} </td>
        <td> => {{x.score}} </td>
      </tr>
    </table>
  </body>
angular.module('app', []);

angular.module('app').controller('mainCtrl', function($scope) {
  $scope.sharedData = [{
    name: 'Subtraction',
    score: 1500
  }]

});

这是工作Plnkr:

发布你在共享数据中的内容?@Pengyy它已经在共享数据中[{“名称”:“减法”,“科学类别”:null,“模式”:null,“分数”:1500}]发布你在共享数据中的内容?@Pengyy它已经在共享数据中[{“名称”:“减法”,“科学类别”:null,“模式”:null,“分数”:1500}]