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

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -