I am trying to implement a popup with a slight delay. However, I am encountering issues where the buttons are not functioning properly without the delay, and they do not appear when I add the delay. I have come across information online mentioning that $timeout is an async function, but I am unsure if that is the root cause of the problem.
Below is the code for the popup:
var myPopup = $ionicPopup.show({
templateUrl: 'templates/components/welcomePopup.html',
scope: $scope,
buttons: [{
text: 'Goodbye!',
type: 'custom-save-button',
onTap: function (e) {
$scope.showSpinner = true
}
}]
})
Here is how I am attempting to delay it:
$timeout(function () {
// Popup content here
}, 3000)
Whenever I add a delay, the buttons do not appear, and without the delay, nothing functions as expected.
buttons: [{
text: 'Goodbye!',
type: 'custom-save-button',
Does anyone have a solution for this issue?
Current implementation:
$timeout(function() {
var myPopup = $ionicPopup.show({
templateUrl: 'templates/components/welcomePopup.html',
scope: $scope,
buttons: [{
text: 'Goodbye!',
type: 'custom-save-button',
onTap: function (e) {
$scope.showSpinner = true
}
}]
})
}, 3000)
Thank you for your time! :)