Skip to content

Commit

Permalink
.prompt() now supports defaultText options; see #1589
Browse files Browse the repository at this point in the history
  • Loading branch information
gregallensworth committed Dec 4, 2015
1 parent 89c47c2 commit 2d1b2e0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions js/angular/service/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ function($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $ionicB
* template: '', // String (optional). The html template to place in the popup body.
* templateUrl: '', // String (optional). The URL of an html template to place in the popup body.
* inputType: // String (default: 'text'). The type of input to use
* defaultText: // String (default: ''). The initial value placed into the input.
* inputPlaceholder: // String (default: ''). A placeholder to use for the input.
* cancelText: // String (default: 'Cancel'. The text of the Cancel button.
* cancelType: // String (default: 'button-default'). The type of the Cancel button.
Expand Down Expand Up @@ -464,6 +465,7 @@ function($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $ionicB
function showPrompt(opts) {
var scope = $rootScope.$new(true);
scope.data = {};
scope.data.response = opts.defaultText ? opts.defaultText : '';
var text = '';
if (opts.template && /<[a-z][\s\S]*>/i.test(opts.template) === false) {
text = '<span>' + opts.template + '</span>';
Expand Down

0 comments on commit 2d1b2e0

Please sign in to comment.