<html data-ng-app="">
<head>
<title> Learning Loops in Angular </title>
</head>
<body>
<div data-ng-controller="SimpleController">
Name:
<br/>
<input type = "text" data-ng-model = "name"/>
<br/>
<ul>
<li data-ng-repeat = "cust in customers | filter : name | orderBy:'city'"> {{cust.name | uppercase}} - {{cust.city | lowercase}} </li>
</ul>
</div>
<script src="Scripts/angular.min.js"></script>
<script type="text/javascript">
function SimpleController($scope) {
$scope.customers = [
{name:'A',city:'Nagpur'},
{name:'B',city:'Bhopal'}
];
}
</script>
</body>
</html>
我无法运行此程序。尝试了几个变化,但仍然无法正常工作。该程序将错误SimpleController抛出为未定义,即使已定义。