【发布时间】:2016-02-24 12:41:37
【问题描述】:
我的控制器中有以下数组数组(script.js 文件):
angular.module('myApp', [])
.controller('oneController', ['$scope', function($scope) {
$scope.countries = [{
"name": "Aruba",
"code": "ABW",
"1960": 54208,
}];
在我的 index.html 文件中,我正在运行一个 ng-repeat 来显示一个包含国家名称、代码和 1960 年人口的表格。
<body ng-app="myApp">
<h1>Challenge Three</h1>
<div ng-controller="oneController">
<table>
<tr ng-repeat="country in countries">
<td>{{ country.name }}</td>
<td> {{ country.code }}</td>
<td> {{ country.1960 }}</td>
</tr>
country.name 和 country.code 显示在表中,但 country.1960 没有。我必须对“1960”使用某种语法才能使其正常工作吗?
【问题讨论】:
标签: angularjs angularjs-ng-repeat