Skip to content

Data sources

ng-select accepts items from an array of objects, inline ng-option elements, or asynchronous/observable data.

Bind an array of objects (or primitives) to the items input.

For simple use cases, omit the items array and declare options directly in the template with ng-option.

Load items from a backend as an observable and bind them with the async pipe.

Inputs used by the examples on this page:

Input Type Default Description
[items] Array<any> [] Items array
bindLabel string label Object property to use for label. Default label
bindValue string - Object property to use for selected model. By default binds to whole object.
[multiple] boolean false Allows to select multiple items.
[loading] boolean - You can set the loading state from the outside (e.g. async items loading)
loadingText string Loading... Set custom text when for loading items

See the NgSelectComponent API reference for the complete list of inputs and outputs.