Ionic popup not working…
<button class = "button" ng-click = "showAlert()">Add Popup Show</button>
$scope.showAlert = function() {
var alertPopup = $ionicPopup.alert({
title: 'Don\'t eat that!',
template: 'It might taste good'
});
alertPopup.then(function(res) {
console.log('Thank you for not eating my delicious ice cream cone');
});
};
sarahhsu:
$ionicPopup
have you injected $ionicPopup in your controller?
Yes, I have!
.controller('ListController', ['$scope', '$http', '$state','$window', '$ionicActionSheet', '$timeout','$ionicPopup', 'updateDbService',function($scope, $http, $state, $window, $ionicActionSheet,$ionicPopup, $timeout,updateDbService) {
ah …
you switched the $timeout and $ionicPopup
'$timeout','$ionicPopup'
and
$ionicPopup, $timeout
2 Likes
Thank you so much! Sorry I just realised I never posted it! Also, why?
haha … I had the same “problem” once … kept me debugging almost a hour untill I figured it out
maxx0r
January 14, 2016, 9:24am
8
I might receive some hate for this…
But when you don’t minify your code, you dont really need to explicitly name your injections.
Thank you so much for posting this. I assumed Ionic didn’t care what order the injected parameters were in because of seeing examples where they were out of order but you helped me fix a bug I’ve spent almost a week trying to fix with this!