https://github.com/forms-angular/fng-select2
select2 plugin for forms-angular
https://github.com/forms-angular/fng-select2
Last synced: 6 months ago
JSON representation
select2 plugin for forms-angular
- Host: GitHub
- URL: https://github.com/forms-angular/fng-select2
- Owner: forms-angular
- License: mit
- Created: 2014-06-18T00:46:08.000Z (over 11 years ago)
- Default Branch: main
- Last Pushed: 2022-01-04T16:42:04.000Z (about 4 years ago)
- Last Synced: 2025-06-10T20:27:13.804Z (7 months ago)
- Language: CSS
- Size: 3.91 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# fng-select2
_*Deprecated in favour of fng-ui-select*_
Plugin for forms-angular that adds select2 support.
## Usage
bower install fng-select2
Add the following lines to your index.html (or equivalent) file
In your Mongoose schemas you can set up fields like this:
colour: {type: String, enum: ['Red', 'Orange', 'Yellow', 'Green', 'Blue', 'Indigo', 'Violet'], form:{select2:true}}
lookup: { type: Schema.Types.ObjectId, ref: 'anotherModel', form: {select2: {}}},
In this case forms-angular will look up all the values in the anotherModel collection when the form is loaded. In the
case where the collection is large you should use the fngAjax option
lookup2: { type: Schema.Types.ObjectId, ref: 'largeModel', form: {select2: {fngAjax:true}}}
which instructs the program to use ajax calls to query the server rather than downloading the table.