I have been attempting to utilize AngularJS to display data from a JSON file, but I am encountering some issues. Despite trying multiple times and even copying examples from others, I still can't seem to identify the problem. I would greatly appreciate any assistance in resolving this issue. Below is my HTML file:
<html>
<head>
<title>Angular JS Includes</title>
</head>
<body>
<h2>AngularJS Sample Application</h2>
<div ng-app = "App" ng-controller = "TodoCtrl">
<ul>
<li ng-repeat="todo in todos">
{{todo.text}} - <em>{{todo.done}}</em>
</li>
</ul>
</div>
<script>
var App = angular.module('App', []);
App.controller('TodoCtrl', function($scope, $http) {
$http.get('todos.json')
.then(function(res){
$scope.todos = res.data;
});
});
</script>
<script src = "https://ajax.googleapis.com/ajax/libs/angularjs/1.2.15/angular.min.js"></script>
</body>
</html>
todos.json:
[{ "text":"learn angular", "done":true },
{ "text":"build an angular app", "done":false},
{ "text":"something", "done":false },
{ "text":"another todo", "done":true }]