I am trying to display a list of { country flag icon + name + phone dial code }, I have used ui-select for implementing this in angular, this is the code that I have used
<ui-select ng-model="viewModel.homePhoneCountryCode" theme="bootstrap" id="homePhoneCountryCode" name="homePhoneCountryCode" ng-disabled="disabled">
<ui-select-match>
{{$select.selected.phoneCode}}
</ui-select-match>
<ui-select-choices repeat="country in countries | filter: $select.search">
<img ng-src="{{country.imageUrl}}" />
<span ng-bind-html="country.name | highlight: $select.search"></span>
<span ng-bind-html="country.phoneCode | highlight: $select.search"></span>
</ui-select-choices>
</ui-select>
The list shows up fine except there seems to be some performance issue when the list is clicked to select a choice and it is not the first time alone that there is a lag but on subsequent clicks as well even though the images are being cached by the browser.
There are around 236 items in the list the flag icons are from http://www.famfamfam.com/lab/icons/flags/ which are relatively small in size
Another issue is that at times when text is input into the search/ filter input the page seems to get stuck with a message indicating a long running js being the cause.
Question 1 : Is this the right way to display remote images in a list.
Question 2 : Is there a way to lazy load in ui-select.
Question 3 : If this is some issue with ui-select is there another option which I could explore that works with angular.