index.html
<html ng-app='myApp'>
<head>
<title>TODO supply a title</title>
<script src="js/angular.js" type="text/javascript"></script>
<script src="js/using built-in directives.js" type="text/javascript"></script>
</head>
<body>
<h1>Using ng-disabled directive</h1>
Name:<input type="text" ng-model="name"/>
<br/>
<button ng-disabled="!name" >sign in</button>
<hr/>
<h1>Button enabled after specified number of seconds </h1>
<button ng-disabled="isDisabled" >sign in</button>
</body>
</html>
using built-in directives.js
var app = angular.module('myApp',[]);
app.run(function($rootScope){
$rootScope.isDisabled = true;
setTimeout(function(){
$rootScope.isDisabled = false;
},3000);
Upon page load, the button remains disabled as expected. However, after 3 seconds, it does not become enabled. What could be causing this issue?