我的ng-repeat出了点问题

时间:2014-06-22 11:51:25

标签: javascript angularjs

似乎并不想渲染。

http://plnkr.co/edit/IoymnpSUtsleH1pXgwFj

app.controller('MainCtrl', function($scope) {
  $scope.lists = [
    {"name": "a"},
    { "name": "b"},
     {"name" :"c"}
  ];
});

HTML

<li ng-repeat="item in lists">
  <span>item.name</span>
</li>

1 个答案:

答案 0 :(得分:2)

您应该使用{{ }}符号,如下所示:

<li ng-repeat="item in lists">
  <span> {{ item.name }}</span>
</li>