This is a code snippet taken from the Guide:
...
// Try to create the first project, make sure to defer
// this by using $timeout so everything is initialized
// properly
$timeout(function() {
if($scope.projects.length == 0) {
while(true) {
var projectTitle = prompt('Your first project title:');
if(projectTitle) {
createProject(projectTitle);
break;
}
}
}
});
...
If I change the code to use $ionicPopup.prompt
(instead of a plain javascript prompt) it does not work at all:
...
// Try to create the first project, make sure to defer
// this by using $timeout so everything is initialized
// properly
$timeout(function() {
if($scope.projects.length == 0) {
while(true) {
$ionicPopup.prompt({
title: 'Project Title',
content: 'Enter your project title',
inputType: 'text',
inputPlaceholder: 'Your first project title'
}).then(function(projectTitle) {
createProject(projectTitle);
break;
});
}
}
});
...
I also updated this line to include $ionicPopup:
.controller('TodoCtrl', function($scope, $timeout, $ionicModal, $ionicPopup, Projects) {
Any ideas?