I'm struggling to understand why the text I input in my controller isn't linking to the view.
After creating two JavaScript files - app.js
and MainController.js
, things still aren't working as expected.
Following a tutorial on Codecademy, I tried replicating a similar scenario. However, it seems like I might be overlooking something quite fundamental, which is eluding me at the moment.
Here are the files I'm working with:
index.html
<!DOCTYPE html>
<html lang="en">
<body ng-app="myApp" ng-controller="MainController">
<h1>{{title}}</h1>
<scipt src="js/app.js"></scipt>
<script src="js/controller/MainController.js"></script>
</body>
</html>
app.js
var app = angular.module('myApp', []);
MainController.js
app.controller('MainController', ['$scope', function ($scope) {
$scope.title = 'Hello!';
}]);
I suspect that the issue could be related to having my Main Controller in a separate file from the app.js script.