Javascript 未调用中的AngularJS函数
这是一个简单的角度控制器,但不起作用。我找不到代码有任何问题。你能吗Javascript 未调用中的AngularJS函数,javascript,html,angularjs,Javascript,Html,Angularjs,这是一个简单的角度控制器,但不起作用。我找不到代码有任何问题。你能吗 <!DOCTYPE html> <html> <head> <title>AngularJS Controller</title> </head> <body> <div ng-controller="SimpleController"> Name: <br/> &
<!DOCTYPE html>
<html>
<head>
<title>AngularJS Controller</title>
</head>
<body>
<div ng-controller="SimpleController">
Name:
<br/>
<input type="text" ng-model="nameText"/>
<br/>
<ul>
<li ng-repeat="cust in customers | filter:nameText | orderBy : 'name' ">{{ cust.name }} - {{ cust.city }}
</li>
</ul>
</div>
<script src="Scripts/angular.min.js"></script>
<script>
function SimpleController ($scope){
$scope.customers = [
{ name:'Konstantinos Korovesis', city:'Pikermi' },
{ name:'Akis Manolis', city:'Argos' },
{ name:'Irem Var', city:'Nea Smirni' },
{ name:'Antonis Ralis', city:'Pallini' }
];
}
</script>
</body>
</html>
AngularJS控制器
姓名:
- {{cust.name}-{{cust.city}
函数SimpleController($scope){
$scope.customers=[
{名称:'Konstantinos Korovesis',城市:'Pikermi'},
{姓名:'Akis Manolis',城市:'Argos'},
{名称:'Irem Var',城市:'Nea Smirni'},
{姓名:'Antonis Ralis',城市:'Pallini'}
];
}
这是我在浏览器中看到的内容
姓名:
[……]
{{cust.name}-{{cust.city}添加。Angular需要它为Angular指定文档的根
<html ng-app>