我想从数组中过滤结果,但我收到错误“SimpleController不是函数,未定义”
<div class="container" ng-controller="SimpleController">
<input type="text" ng-model="name">
<ul>
<li ng-repeat="PersonNames in names | filter:name | orderBy:name">{{ PersonNames.name }} - {{PersonNames.city}}</li>
</ul>
</div>
JS
<script>
function SimpleController($scope){
$scope.names =[
{name:'Danial Pervaiz' , city:'Denver'},
{name:'David Johnson' , city:'Jamaica'},
{name:'David Hopsin' , city:'Australia'}
];
}
</script>