javascript - AngularJS Select List doesnt match selected Item -


i have global controller in angularjs application provides me array containing attendee objects. want want modify courseregistration model contains 1 specific attendee object. in edit window d dropdown possible attendees whereas there should current attendee selected.

i have following code in html:

        <select ng-model="courseregistration.attendee" ng-options="attendeeselectitem.name attendeeselectitem in attendeeselectitems"></select> 

if print out courseregistration.attendee json.stringify , same corresponding option print out same object (same id, same name etc.). if (courseregistration.attendee == attendeeselectitem) 2 identical objects, false.

so question how can make sure selected item (stored in courseregistration.attendee) gets matched corresponding object in list (which used options) ?

thanks lot in advance.

jsfiddle: http://jsfiddle.net/2ddcy/

greets marc

essentially when use array of objects populate select, selects entire object, not 1 item you're seeing in select list.

see question detail , example code: problems when using ng-options , ng-switch together


Comments

Popular posts from this blog

ruby on rails - Permission denied @ sys_fail2 - (D:/RoR/projects/grp/public/uploads/ -

c++ - nodejs socket.io closes connection before upgrading to websocket -

java - What is the equivalent of @Value in CDI world? -