Skip to content

Commit

Permalink
Create placeholder for non-required references. Closes #53
Browse files Browse the repository at this point in the history
  • Loading branch information
mchapman committed Oct 6, 2014
1 parent 2bbc49b commit bc69271
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 5 additions & 1 deletion dist/forms-angular.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! forms-angular 2014-10-03 */
/*! forms-angular 2014-10-06 */
'use strict';

var formsAngular = angular.module('formsAngular', [
Expand Down Expand Up @@ -283,6 +283,10 @@ formsAngular.controller('BaseCtrl', ['$injector', '$scope', '$location', '$timeo
if (formInstructions.select2.fngAjax) {
// create the instructions for select2
select2ajaxName = 'ajax' + formInstructions.name.replace(/\./g, '');
// If not required then generate a place holder if none specified (see https://github.com/forms-angular/forms-angular/issues/53)
if (!mongooseOptions.required && !formInstructions.placeHolder) {
formInstructions.placeHolder = 'Select...';
}
$scope[select2ajaxName] = {
allowClear: !mongooseOptions.required,
minimumInputLength: 2,
Expand Down

0 comments on commit bc69271

Please sign in to comment.