Я создаю страницу списка дел в angular javascript. Я получаю модульную ошибку:
Uncaught Error: [$injector:modulerr]
На самом деле не знаю, откуда взялась ошибка.
Это представление (индекс. html):
<!DOCTYPE html>
<html ng-app="myApp" lang="en">
<head>
<h1>To do List</h1>
<script
src="https://ajax.googleapis.com/ajax/libs/angularjs/1.6.9/angular.min.js"></script>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body ng-controller="todoCtrl">
<form ng-submit="toDoAdd()">
<input type="text" ng-model="todoInput" size="50" placeholder="Add New">
<input type="submit" value="Add New">
<br>
<div ng-repeat="x in todoList">
<input type="checkbox" ng-model="x.done"><span ng-bind="x.todoText">
</span>
</div>
<p>
<button ng-click="remove()">Remove marked</button></p>
</form>
</body>
</html>
Это контроллер (приложение js):
var app = angular.module('myApp', []);
app.controller('todoCtrl',[ function ($scope) {
$scope.toDoList=[{todoText:"check", done:false}];
$scope.toDoAdd=function () {
var oldlist= $scope.toDoList;
$scope.toDoList = [];
angular.forEach(oldlist, function (x) {
if(!x.done) $scope.toDoList.push(x);
})
}
app.factory('mySomething', function(){
console.log("mySomething.$get() called");
return "My Something";
});
}])