Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save oddlyfunctional/25fa67259ee71b7bb9926cca8ba58b2c to your computer and use it in GitHub Desktop.
Save oddlyfunctional/25fa67259ee71b7bb9926cca8ba58b2c to your computer and use it in GitHub Desktop.
$timeout with nested callbacks
$timeout(function() {
if (!$scope.promiseComplete && $scope.submitted) {
$scope.message = {
content: [{
title: '',
msg: 'Service down - created'
}],
type: 'error'
};
$timeout(function() {
$scope.message = null;
$timeout(function() {
if (userDidntChangeAnything()) {
$scope.message = {
content: [{
title: '',
msg: 'Do you need any help? Talk to our support in our online chat!'
}],
type: 'notification'
};
$timeout(function() {
$scope.message = null;
}, 2000);
}
}, 5000);
}, 2000);
}
}, 5000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment