Ok, I have the following:
<select ng-model="item" ng-change="monthpickerclick()">
<option class="animate-repeat" ng-repeat="returnpicker in monthpicker(singles)" value="{{returnpicker.date}}">{{returnpicker.date}}</option>
</select>
each option has this object:
returnpicker: Object
$$hashKey: "02O"
Year: 2014
dailyPrice: "165"
date: "January-2014"
minimumStay: 5
month: 0
monthlyPrice: "4000"
reserved: false
weeklyPrice: "880"
How can I get the object values for each option when choosing from my controller? currently it is:
scope.$watch('item', function(){
console.log(scope.item);
});
returns the value of the parameter string, but do I need to get both the month and the year? as???
I also tried:
<select ng-model="item" ng-options="o.month as o.month for o in monthpicker(singles)" ng-click="monthpickerclick()">{{item}}</select>
but this removes all other values from the object from the option.
source
share