I have an Input box that accepts characters which gets disable instantly when the correct value is entered using ng-disabled
However when I move to the next item and prev the next button the page refreshes
= 4) &&
I need to be able to place the index of the question into Cache
localStorage.setItem();
Controller:
$scope.initializeGame = function() {
$scope.score = (localStorage.getItem("token")) ? parseInt(localStorage.getItem("token")) : 0;
$scope.scoreValue = $scope.score
$scope.noOfTries = 0;
$scope.original = $scope.pageTitle;
$scope.guess = null;
$scope.deviation = null;
$scope.verifyGuess = function() {
$scope.deviation = $scope.original - $scope.guess;
$scope.noOfTries = $scope.noOfTries + 1;
$scope.falseAnswer = $scope.deviation != 0;
if ($scope.deviation == 0 && $scope.noOfTries == 1) {
$scope.scoreValue = parseInt($scope.score, 10) + 1;
var token = $scope.scoreValue;
localStorage.setItem("token", token);
};