Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/forms-angular/fng-select2
select2 plugin for forms-angular
https://github.com/forms-angular/fng-select2
Last synced: 10 days 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 10 years ago)
- Default Branch: main
- Last Pushed: 2022-01-04T16:42:04.000Z (almost 3 years ago)
- Last Synced: 2024-11-05T23:39:20.218Z (about 2 months ago)
- Language: CSS
- Size: 3.91 KB
- Stars: 0
- Watchers: 3
- 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 optionlookup2: { 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.