正如標題所暗示的,我似乎無法得到NG-重複工作,即使有一個精簡版,可能會有人來看看NG重複未初始化
http://plnkr.co/edit/ww2AIzOtO58TSqlnwbSG?p=preview
var app = new angular.module('myApp', [
])
.controller('GemsCtrl', function GemsCtrl($scope) {
$scope.gems = gems;
$scope.thisIsFine = "what gives?";
var gems = [
{
name: 'Azurite',
description: "Some gems have hidden qualities beyond their luster, beyond their shine... Azurite is one of those gems.",
shine: 8,
price: 110.50,
rarity: 7,
color: '#CCC',
faces: 14,
images: [
"images/gem-02.gif",
"images/gem-05.gif",
"images/gem-09.gif"
],
reviews: [{
stars: 5,
body: "I love this gem!",
author: "[email protected]",
createdOn: 1397490980837
}, {
stars: 1,
body: "This gem sucks.",
author: "[email protected]",
createdOn: 1397490980837
}]
}
和HTML ...
<!DOCTYPE html>
<html ng-app="myApp">
<head>
<script src="https://code.angularjs.org/1.3.0-rc.1/angular.js" data-semver="1.3.0-rc.1" data-require="[email protected]*"></script>
<link rel="stylesheet" href="style.css" />
<script src="script.js"></script>
</head>
<body ng-controller="GemsCtrl">
{{thisIsFine}}
<table class="table table-striped">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>view</th>
<th>Settings</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="gem in gems">
<th>{{gem.name}}</th>
<th>{{gem.description}}</th>
<th>
<a class="btn" href="">view </a>
</th>
<th>Settings</th>
</tr>
</tbody>
</table>
<h1>Hello Plunker!</h1>
</body>
</html>
,讓我知道我要去哪裏錯了嗎?
移動'$ scope.gems =寶石;''後VAR寶石= [...]' – 2014-09-18 15:55:44