为什么 angular 给出的函数不是函数,未定义的错误(当我更改 CDN 版本时工作正常)

why angular gives function not a function, undefined error (Works fine when I change the CDN version)

我不熟悉 MEAN 堆栈技术和构建测试应用程序。我正在使用 angulrjs 如下。

<!DOCTYPE>
<html ng-app>
<head>
    <!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">

<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap-theme.min.css">
    <title>contact lists app</title>
</head>
<body>
    <div class="container" ng-controller="AppCtrl">
<h1>Contact List app</h1>
<table class="table">
    <thead>
        <tr>
            <th>Name</th>
            <th>Email</th>
            <th>Number</th>
        </tr>
    </thead>
</table>

</div>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.7/angular.min.js"></script>

<script type="text/javascript">
function AppCtrl(){
  console.log("testing");
}
</script>

</body>
</html>

当这个 运行 在服务器中时,我在 browser.then 中查找控制台,它显示以下错误

link 描述是

在我添加之前,angular 工作正常并且没有显示任何 error.hope 你对 this.thanx

的帮助

注意:我尝试在不同的文件夹中添加自定义 js 文件,它也没有用

注意:我正在使用 GOOGLE CDN 与 ANGULAR.IN 一起工作,这里我使用的是最新版本,如果我使用以前的版本,它们就是 PROVIDING.BUT喜欢:

<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.28/angular.min.js"></script>

然后它工作正常。

首先你必须实例化模块:

var app = angular.module('app', []);

然后你必须实例化你的控制器:

app.controller('AppCtrl', function($scope) {

});

在你的 HTML 中:

<html ng-app="app">

你可以了解更多here