In my JavaScript code, I have implemented a timeout function:
setTimeout(function () {
$scope.shadow = 'speller-blue';
currIndex = Math.floor(Math.random() * 2);
$scope.currCard = cards[currIndex];
}, 1000);
Additionally, I am utilizing ng-class in my HTML:
<input id="speller-box" type="text" class="form-control ng-class:shadow" autofocus="" placeholder="answer" ng-model="answer">
Despite expecting the code inside the timeout function to execute after a one-second delay and change the field's color to blue, the actual color change does not occur until the input value is altered.