I'm attempting a simple example, but for some reason the values are not rendering in the browser (appear as {{user.firstName}} in the web page).
I verfied my code matches exactly with the text book example as well as instructor demos. It also exactly mirrors other examples on w3schools. I can't figure out why its not working.
Here's my main.js:
var myApp = angular.module('myApp',[]);
myApp.controller('UserController',function UserController($scope){
$scope.user = {
firstName: 'Peebo',
lastName: 'Sanderson'
};
});
Here is my index.html:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Data Binding</title>
<script> src="https://ajax.googleapis.com/ajax/libs/angularjs/1.8.2/angular.min.js"</script>
<script> src="main.js"</script>
</head>
<body ng-app="myApp">
<h1>Data Binding Using AngularJS</h1>
<div ng-controller="UserController">
<p>First: {{user.firstName}}</p>
<p>Last: {{user.lastName}}</p>
</div>
</body>
</html>