Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2d1b2e0

Browse files
committedDec 4, 2015
.prompt() now supports defaultText options; see #1589
1 parent 89c47c2 commit 2d1b2e0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed
 

‎js/angular/service/popup.js

+2
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,7 @@ function($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $ionicB
253253
* template: '', // String (optional). The html template to place in the popup body.
254254
* templateUrl: '', // String (optional). The URL of an html template to place in the popup body.
255255
* inputType: // String (default: 'text'). The type of input to use
256+
* defaultText: // String (default: ''). The initial value placed into the input.
256257
* inputPlaceholder: // String (default: ''). A placeholder to use for the input.
257258
* cancelText: // String (default: 'Cancel'. The text of the Cancel button.
258259
* cancelType: // String (default: 'button-default'). The type of the Cancel button.
@@ -464,6 +465,7 @@ function($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $ionicB
464465
function showPrompt(opts) {
465466
var scope = $rootScope.$new(true);
466467
scope.data = {};
468+
scope.data.response = opts.defaultText ? opts.defaultText : '';
467469
var text = '';
468470
if (opts.template && /<[a-z][\s\S]*>/i.test(opts.template) === false) {
469471
text = '<span>' + opts.template + '</span>';

0 commit comments

Comments
 (0)
Please sign in to comment.