Javascript AngularJS模块没有';t载荷
我的模块没有加载,我不知道为什么。有人能帮我找出我做错了什么吗 以下是我在名为index.HTML的文件中的HTML:Javascript AngularJS模块没有';t载荷,javascript,html,debugging,angularjs,module,Javascript,Html,Debugging,Angularjs,Module,我的模块没有加载,我不知道为什么。有人能帮我找出我做错了什么吗 以下是我在名为index.HTML的文件中的HTML: <html ng-app="demoApp"> <head> <title>Using AngularJS Directives and Data Binding</title> <script type="text/javascript" src="_Script.js">&l
<html ng-app="demoApp">
<head>
<title>Using AngularJS Directives and Data Binding</title>
<script type="text/javascript" src="_Script.js"></script>
<script src="angular.min.js"></script>
</head>
<body>
<!-- Get name out of array with controller using a module-->
<h3>Get names out of an array with controller using a module:</h3>
<div class ="container" ng-controller="SimpleController">
<input type="text" ng-model="search" /> {{ search }}
<ul>
<li ng-repeat="naam in namen | filter:search" >{{ naam }}</li>
</ul>
</div>
</body>
</html>
我什么都找过了,所以可能很简单。但是我找不到它,我被它卡住了
请注意,您当前先加载_script.js,然后加载angular js。如果您对它们重新排序,您的脚本应该可以工作:
@PGriep,不要。愚蠢的错误在编程中是正常的。JavaScript可以让您在不提醒您的情况下执行比某些语言更多的操作。前几天我不小心给$scope.value赋值,而是直接给$scope赋值,这突然意味着$scope在任何地方都不能正常工作:)
var demoApp = angular.module('demoApp', []);
function SimpleController($scope) {
$scope.namen = [
'John',
'Will',
'Alex'
];
}
demoApp.controller('SimpleController', SimpleController);