Does anyone know why $ionicPopup is undefined?
sample code
angular.module('post.controllers', ['post.services'])
.controller('postCtrl', ['$scope', '$state', '$stateParams',
function (postService, $scope, $state, $stateParams, $ionicLoading, $ionicPopup) {
console.log($ionicPopup) //<-- here I get undefined
showAlert("hi") // <-- app crashed and it says "Can read property 'alert' of undefined"
function showAlert(message) {
var alertPopup = $ionicPopup.alert({
title: 'Alert',
template: message
});
}
}])