var four = function() {
$scope.text += '4';
}
var five = function() {
$scope.text += '5';
}
$scope.text = '1';
$timeout(function () {
$scope.text += '2'
});
$timeout($scope.text += '3');
$timeout($scope.$eval(four));
$timeout(five);
Result: 13425
According the call sequence the result should be 12345. The lines below are executed immediately:
$timeout($scope.text += '3');
$timeout($scope.$eval(four));
And if you add the time parameter like below, the time is ignored.
$timeout($scope.text += '3', 1000);
$timeout($scope.$eval(four), 1000);
$timeouttakes a function