Skip to content

Angular directive that render a select tag with defined values and add a special value (typically 'other...') which when selected convert then select to an input text

License

Notifications You must be signed in to change notification settings

fantarama/angular-form-preselect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

angular-form-preselect

Angular directive that render a select tag with defined values plus a special value (typically 'other...') that if selected convert the select field to an input text.

When in text mode press the 'esc' button to return to the select mode.

Example:

<ng-form-preselect 
  name="test"
  options="['1','2','3']"
  other="'other...'"
  placeholder="'insert your text'"
  on-change="demo.onChange(value)"
  required="true></ng-form-preselect>

Attributes

name - string: then field's name

options - array of string: then array options to show on select field

other - string: the other value to add at the bottom of the options list

placeholder - string: the placeholder list to show on text field

on-change - ref: the parent scope function to call on value change (both select and text mode)

required - boolean: same as the ng-required attributes on fields

About

Angular directive that render a select tag with defined values and add a special value (typically 'other...') which when selected convert then select to an input text

Resources

License

Stars

Watchers

Forks

Packages

No packages published