-
Notifications
You must be signed in to change notification settings - Fork 109
Description
I'm trying to set the items in the multiselect as select based on a model that I get from an http request.
Im not sure if this has something to do with the order I set the model and the options, but after the promise returns, I got both the options and the model, like this:
Model: [
{id: 1, nome: "Cafés"},
{id: 2, nome: "Bares"} ];
Options: [
{id: 1, nome: "Cafés"},
{id: 2, nome: "Bares"},
{id: 3, nome: "Restaurantes"}];
And the multiselect like this:
<multiselect ng-model="Model" options="Options" id-prop="id" display-prop="nome"></multiselect>
The options are displayed correctly, like the options array, but the options on the model are not selected, and I think they should, because the multiselect element is displayed based on both the model and the options.
Basically the model is updated based on the template, but the opposite is not happening. When I set the model on the controller, I dont see this changes reflected in the template(display the items selected, for example).

Two of the items in this image should be selected, since they are in the model array.