From 034a9e6e4d9647f99a2382efae65e3bd1dfb3950 Mon Sep 17 00:00:00 2001 From: Ahmad Ali Date: Mon, 20 Oct 2014 16:43:19 +0500 Subject: [PATCH] Added place holder to auto generated element Before this edit we can add placeholder-value to custom fields but using the ui list input with an auto-generated text element did not allow to add a placeholder simply because the auto generated element template was not complete with a placeholder. Now after edit a user can add a placeholder attribute like in any HTML input in the main div beside ng-model attribute. --- src/list-input.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/list-input.js b/src/list-input.js index 3767a98..5a6a504 100644 --- a/src/list-input.js +++ b/src/list-input.js @@ -451,9 +451,11 @@ angular.module('ui.listInput', []) transcludedInput.eq(transcludedInput.length - 1).attr('ng-blur', 'updateItems()'); } else { - // The transcluded content did not have an input, so create one. + // The transcluded content did not have an input, so create. + // add a placeholder + var placholdercontent = 'placeholder="'+attributes.placeholder+'"' if (transcludedInput.length === 0) { - transcludedInput = angular.element(''); + transcludedInput = angular.element(''); } // Enforce a name for validation @@ -513,4 +515,4 @@ angular.module('ui.listInput', []) templateUrl: 'remove-item-button.tpl.html', replace: true }; -}); \ No newline at end of file +});