I cannot figure out why my simple AngularJS app not working as intended. \"Loading...\" is supposed to be hidden, and \"Done!\" should be shown after 1 second.
html:
You need to use $timeout and inject it in your controller:
$timeout
function TestCtrl($scope, $timeout) { $scope.loading = true; $timeout(function () { $scope.loading = false; }, 1000); }
Fiddle demo
Edit: removed $scope.apply(); as @Salman suggested
$scope.apply();