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
{{ message }}
This repository was archived by the owner on Oct 2, 2019. It is now read-only.
I've been saving my model to a service when I leave a page, and loading it back in with the scope. This works fine for ui-select, except for multiple-search inputs. When looking at the scope object on page load, the selected options are there. Once the directive loads, the object that held the selections is an empty array. This is happening because I am setting the options to an empty array on page load, when they are getting emptied, it is somehow clearing out the previous selected items.
I tried setting the options to null or undefined, but ui-select throws a bunch of errors.
I found a work around for now, on line 792 of the Plunker I provided below, I added the line
ngModel.$viewValue = ngModel.$modelValue;
I've tried finding the source of the problem, but had no luck. Adding this line seems to have everything working for now, but I'm not sure if it broke anything else.
The text was updated successfully, but these errors were encountered:
ghost
changed the title
Loading Data from Multi-Search Input Fails. Possible Workaround inside
Loading Data On Init Into Multi-Search Input Not Working. Possible Workaround inside
Nov 5, 2014
I've been saving my model to a service when I leave a page, and loading it back in with the scope. This works fine for ui-select, except for multiple-search inputs. When looking at the scope object on page load, the selected options are there. Once the directive loads, the object that held the selections is an empty array. This is happening because I am setting the options to an empty array on page load, when they are getting emptied, it is somehow clearing out the previous selected items.
I tried setting the options to null or undefined, but ui-select throws a bunch of errors.
I found a work around for now, on line 792 of the Plunker I provided below, I added the line
ngModel.$viewValue = ngModel.$modelValue;
I've tried finding the source of the problem, but had no luck. Adding this line seems to have everything working for now, but I'm not sure if it broke anything else.
http://plnkr.co/edit/Ijygdiux4rAg9RlfOfvw?p=preview
The text was updated successfully, but these errors were encountered: