How to get the object of selected option in angular js using ng-repeat? Sample fiddle is here where myself populating the dropdown as,
<select ng-model="id" ng-init="id = '-1'" ng-change="select(option)">
<option value="-1">--Select--</option>
<option ng-repeat="option in list" value="{{option.id}}">{{option.name}}</option>
</select>
If someone chose option with id=1, i want to get the object {id:1, name:'A' in $scope variable.
EDIT: Myself tried with ng-options but filtering is not happening as required based on previous dropdown selection. sample fiddle
ngOptionsinstead of manually repeating out the options. From the documentation:ngOptions should be used when the <select> model needs to be bound to a non-string value.ng-optionsfilter won't working properly fiddle: jsfiddle.net/mpsbhat/779pz05o/5