I'm having issues transferring my JSON data to HTML with Angular.JS, I'm doing a programming course and this is an issue I came across that the author doesn't seem to have, can anyone help?
I linked angular correctly, I added the app correctly, it should work, any ideas?
https://pastebin.com/K4HR23Tk - HTML
<html ng-app="myQuiz">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Test Your Knowledge: Saturn</title>
<link rel="stylesheet" type="text/css" href="css/quiz.css">
</head>
<body>
<div id="myQuiz" ng-controller="QuizController">
<h1>Test Your Knowledge: <span>Saturn</span></h1>
<div class="progress"> {{totalQuestions}} </div>
https://pastebin.com/5emA4016 - JS
(function(){
var app = angular.module('myQuiz',[]);
app.controller('QuizController',['$scope', '$http', '$sce', function($scope,$http,$sce){
$scope.score = 0;
$scope.activeQuestion = -1;
$scope.activeQuestionAnswered = 0;
$scope.percentage = 0;
$http.get('quiz_data.json').then(function(quizData){
$scope.myQuestions = quizData.data;
$scope.totalQuestions = $scope.myQuestions.length;
});
});
})();