Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/72.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 未调用中的AngularJS函数_Javascript_Html_Angularjs - Fatal编程技术网

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>