Issues fiddle here dropdown issue with default selection Below the JSON used to populate the drop down.
{
"key": "all",
"value": "First",
"default":"N"
},
{
"key": "only_my_events",
"value": "Default",
"default":"Y"
},
{
"key": "only_assigned",
"value": "Second",
"default":"N"
},
{
"key": "only_owner",
"value": "Third",
"default":"N"
},
{
"key": "none",
"value": "Fourth",
"default":"N"
}
Drop down code to display the item
<select ng-model="mail_notification" ng-options="c.key as c.value for c in mail_notifications" ng-init = "c.default = 'Y'"></select>
Required
The default item selected should be the item with default value is Y (default = 'Y').
Issues.
First item in the drop down is empty. there is no default selected item.
Already tried.
Seen solution like setting a default value like " Choose an Item", which is not im looking for. AngularJS. When select have ng-model attribute, ng-selected not working