satya chowdary satya chowdary - 4 months ago 47
AngularJS Question

implementation of ng-options

i want to show A abd B as my options list from the below

"A": {
"status": 3,
"event": "Door was opened",
"name": "xxxxxx ",
"latlng": "xxxxx"

"B": {
"status": 4,
"event": "kitchen was opened",
"name": "xxxxx ",
"latlng": "xxxxx"

iam trying like this

<select ng-change="selected(prop)" style="color:black;" ng-model="prop" ng-options="item as item for item in devices">
<option value="">-- choose an option --</option>


You can have like this,

<label for="reason">Device</label>
   <select ng-change="selected(Device)" ng-model="Device" ng-options="key as key for (key , value) in devices"></select>