Tôi đang sử dụng máy chủ Apache để lưu trữ ứng dụng góc cạnh. Đây là index.html:
<html>
<head>
<script src="/lib/angular/angular.js">
</head>
<script>
myapp = angular.module('myapp', []);
myapp.controller('indexCtrl', function($scope){
$scope.words = ['It','is','what','it','is']
});
</script>
<body ng-app="myapp">
<div ng-controller="indexCtrl">
<div ng-repeat="word in words">
{{word}}
</div>
</div>
</body>
</html>
Khi tôi nhấn html từ trình duyệt, nó cho thấy một trang trống với lỗi này:
Uncaught Error: [$injector:modulerr] Failed to instantiate module myapp due to: Error: [$injector:nomod] Module 'myapp' is not available!
You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
Điều gì có thể xảy ra?
điều này là do bạn không đóng thẻ tập lệnh. – Ved
Wow. những gì một phiếu. cảm ơn người đàn ông! – moaglee