I want to disable my button but then activate it a few seconds later. The code does run but the button is still disabled even after my code has executed.
app.controller('spamController', ['$scope', function($scope) {
$scope.stopSpam = false;
function activateBtn(){
$scope.stopSpam = false;
};
$scope.test = function(){
$scope.stopSpam = true;
activateBtn();
};
}]);
<button ng-disabled="stopSpam" class="btn btn-default" ng-click="test()">Test</button>