Reputation: 320
this is my json [["A","aaa"],["B","bbb"],["C","ccc"]] here the data 'aaa', 'bbb' and 'ccc' should be displayed in the dropdown when the data is selected their corresponding values ie 'A', 'B' or 'C' should be populated in the another variable
Upvotes: 0
Views: 45
Reputation: 338
I have this selector:
%select{"ng-model" => "recipeDifficulty", "ng-options" => "d.description for d in difficulties"}
And when I select one and click in a button, in my controller I add it to a JSON:
recipe = { ... 'difficulty_id': $scope.recipeDifficulty.id, ... }
I get the values from a db table with two fields: 'id' and 'description'
Upvotes: 0