I want the browser to wait for 3 seconds before executing the next line of code.
$timeout(3000); in script is not seeming to do the trick. Am I doing anything wrong here.
I use it inside a $scope function
app.expandController = function ($scope,$interval, $timeout) {
$scope.nextLevel = function () {
//stop numbers
$scope.StopTimer();
$timeout(function(){return true;},3000);
//restart timer with new numbers
$scope.StartTimer();
$scope.thresholdwatch == false
}
}
and I split controller file by passing $scope and $timeout to another function
app.controller('myCtrl', function ($scope, $interval, $timeout) {
app.expandController($scope, $interval,$timeout);
});