Я пытаюсь следовать учебник с помощью блокнота и Chrome, вот код, который я имею, но это приходит с ошибкойУгловой JS простой тест не работает?
Error: [ng:areq] Argument 'testhere' is not a function, got undefined
http://errors.angularjs.org/1.3.15/ng/areq?p0=testhere&p1=not%20a%20function%2C%20got%20undefined
Любая идея, что на земле, я здесь отсутствует? Я уверен, что это тривиально и глупо, но не может найти его для меня!
<html ng-app>
<head>
<script>
function testhere($scope)
{
$scope.totalcount=4;
}
</script>
<script type="text/javascript" src="js/angular.js"></script>
</head>
<body>
<div ng-controller="testhere">
{{totalcount}}
</div>
</body>
</html>
Вы используете Angular 1.3, это означает, что вам нужно создать модуль и прикрепить к нему контроллер: 'angular.module (« myApp », []). Controller (« testhere », function() {.. .}); –