You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
The text was updated successfully, but these errors were encountered:
I have the same problem. But in my case Options are updated async.
I have discovered that the Model is reset when i change Options. So i do this :
copyModel = angular.copy(Models);
http.get().then((response) => {
Options = response.data;
// Here model is reset so i apply the copy
Models = copyModel;
}
But the HTML component is not updated.
Instead of "2 selected" i have "Selection" until i click on drop button.
I try to call manually $digest but it didn't works
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:
And the multiselect like this:
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.
The text was updated successfully, but these errors were encountered: