Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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.