Skip to content

Commit

Permalink
cleanup of inputType to use consistent template substitution instead …
Browse files Browse the repository at this point in the history
…of raw string interpolation; see #4707
  • Loading branch information
gregallensworth committed Dec 4, 2015
1 parent 56e9706 commit d3fad60
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/angular/service/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,7 @@ function($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $ionicB
function showPrompt(opts) {
var scope = $rootScope.$new(true);
scope.data = {};
scope.data.fieldtype = opts.inputType ? opts.inputType : 'text';
scope.data.response = opts.defaultText ? opts.defaultText : '';
scope.data.placeholder = opts.inputPlaceholder ? opts.inputPlaceholder : '';
scope.data.maxlength = opts.maxLength ? parseInt(opts.maxLength) : '';
Expand All @@ -476,7 +477,7 @@ function($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $ionicB
}
return showPopup(extend({
template: text + '<input ng-model="data.response" '
+ 'type="' + (opts.inputType || 'text') + '" '
+ 'type="{{ data.fieldtype }}"'

This comment has been minimized.

Copy link
@kaiquewdev

kaiquewdev Dec 4, 2015

Why this don't have other value if the property value is "empty|undefined|false|0"? Like the removed line.

+ 'maxlength="{{ data.maxlength }}"'
+ 'placeholder="{{ data.placeholder }}"'
+ '>',
Expand Down

2 comments on commit d3fad60

@gregallensworth
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inputType does have a default, set at line 469 -- 'text' will be used, same as the current behavior.

@kaiquewdev
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gratitude for your answer.

Please sign in to comment.