I want to create a one-page web application without the need for additional files like app.js or controller.js
The code example I tried using resulted in an error:
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.
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title> JavaScript Angular</title>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.8/angular.js">
var myАpp = angular.module("myАpp", []);
myАpp.controller("firstController", function($scope){
$scope.test = "test-to-test";
});
</script>
</head>
<body ng-app = "myApp">
<div ng-controller = "firstController">
{{test}}
</div>
</body>
</html>
My question is, can I achieve this by having only one file index.html with Angular and still include a controller within?