fix(popup): only override prompt input if template includes HTML

This commit is contained in:
Perry Govier
2014-08-08 15:00:19 -05:00
parent c336e8ede8
commit 044fac4d77
2 changed files with 17 additions and 1 deletions

View File

@@ -464,8 +464,13 @@ function($ionicTemplateLoader, $ionicBackdrop, $q, $timeout, $rootScope, $docume
function showPrompt(opts) {
var scope = $rootScope.$new(true);
scope.data = {};
var text = '';
if(opts.template && /<[a-z][\s\S]*>/i.test(opts.template) === false){
text = '<span>'+opts.template+'</span>';
delete opts.template;
}
return showPopup( extend({
template: '<input ng-model="data.response" type="' + (opts.inputType || 'text') +
template: text+'<input ng-model="data.response" type="' + (opts.inputType || 'text') +
'" placeholder="' + (opts.inputPlaceholder || '') + '">',
scope: scope,
buttons: [{