I'm using angular chosen plugin for selecting an attribute on any select element.
My data is in this format:
$scope.pets = [ { id: '1', name: 'Dog', desc:"Something" }, { id: '2', name: 'Cat', desc:"Something" }, { id: '3', name: 'Rat', desc:"Something" } ];
And the angular choosen implementation for displaying the name using ng-options is:
<select multiple ng-model="myPets" ng-options="r as r.name for r in pets" chosen>
I'm able to get the drop down using ng-options for the above data like this,
But how can I bind the default values into the angular choosen input box if my ng model is bind to the following object:
$scope.myPets= { id: '6', name: 'Pig', desc:"Something" },