gpt4 book ai didi

javascript - ng :areq error in simple app

转载 作者:行者123 更新时间:2023-11-29 21:46:38 25 4
gpt4 key购买 nike

<分区>

我有这个非常简单的 Angular 示例:

<html ng-app>
<head>
<title>Angular Test</title>
</head>
<body ng-controller='myController'>
<h1>Angular Test</h1>
<p>{{hello.text}}</p>
<script src='https://ajax.googleapis.com/ajax/libs/angularjs/1.3.16/angular.min.js'></script>
<script>
function myController ($scope) {
$scope.hello = {text : 'Hello World!'};
}
</script>
</body>
</html>

如您所见,我正在使用 CDI 中的 Angular。虽然当我在浏览器中查看时出现以下错误:

Error: [ng:areq] http://errors.angularjs.org/1.3.16/ng/areq?p0=myController&p1=not%20a%20function%2C%20got%20undefined
at Error (native)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.3.16/angular.min.js:6:417
at Sb (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.16/angular.min.js:19:510)
at La (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.16/angular.min.js:20:78)
at $get (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.16/angular.min.js:75:465)
at https://ajax.googleapis.com/ajax/libs/angularjs/1.3.16/angular.min.js:57:178
at q (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.16/angular.min.js:7:428)
at M (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.16/angular.min.js:57:45)
at g (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.16/angular.min.js:51:409)
at g (https://ajax.googleapis.com/ajax/libs/angularjs/1.3.16/angular.min.js:51:426)

我刚刚开始使用 Angular,所以这很可能是一个非常菜鸟的错误。

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com