0
我的代碼:AngularJS簡單的控制器不工作
<!DOCTYPE html>
<head>
<title>Learning AngularJS</title>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.0.7/angular.min.js" type="text/javascript"></script>
</head>
<body>
<div class="container" style="background: #eec; min-height:300px; margin-top: 15px;" ng-controller="SimpleController">
<ul>
<li ng-repeat="woman in customer">{{ woman.name }}</li>
</ul>
</div>
JS(控制器和數據):
<script>
function SimpleController($scope) {
$scope.customer = [
{ name: 'Kamila', city: 'Opava' },
{ name: 'Nikola', city: 'Opočno' },
{ name: 'Jana', city: 'Pardubice' },
{ name: 'Martina', city: 'Hradec Kralove' },
{ name: 'Justýna', city: 'Chrudim' }
];
};
</script>
</body>
</html>
結果我的瀏覽器:{{ woman.name }}
只
我不知道哪裏是錯誤。