Angular Selection - Model Binding (not a value)

I am using angular -selectize plugin . I do not see how to get the whole object as a selected item, not just the value.

See this plunkr

For example: Instead of getting "1000" as the selected item, I would like to get:

{
    "value": "1000",
    "name": "LONDON",
    "longitude": "-0.14922",
    "latitude": "51.49267",
    "class": "Your Most Searched"
}

I am sure this is trivial, but I don’t see how to do this with my attribute ng-model.

Any help was appreciated.

+4
source share
1 answer

This is a problem that has already occurred as a problem in the GitHub repository, see here

, , , - , . Lodash Underscore .

+3

Source: https://habr.com/ru/post/1610006/


All Articles