I'm pretty new to (real) javascript and new to Angular
I'm writing an app for home automation. The app returns a list of devices and then when you click on a device, it returns it's details via JSON (Example below). The problem I have is that different device types return different name value pairs in the object and I won;t know these in advance. (For example a light switch will return a dim level, but a thermostat returns a sensor level.
Obviously, my app can only do stuff with know properties (e.g. set dim level if it's a light), but the user may want to see all the properties. Is their a way to use ng-repeat to list all the name value pairs without knowing the property names?
Example:
{
"name": "1-Wire Test1",
"address": 0,
"addressStr": "unknown",
"classID": 3,
"devProtocol": 999,
"displayInUI": true,
"displayLongState": "76.7 °F",
"displayRawState": "76.700000",
"folderID": 1418405935,
"hasStateToDisplay": true,
"id": 704024169,
"lastChanged": 456266814,
"lastChangedDateStr": "2014-06-16",
"lastChangedRFC3339": "2014-06-17T01:46:54Z",
"lastChangedRFC822": "Tue, 17 Jun 2014 01:46:54 GMT",
"lastChangedTimeStr": "08:46:54 PM",
"sensorValue": "76.7 °F",
"type": "1-Wire Temperature Sensor",
"typeFlags": 81,
"typeSupportsDim": false,
"typeSupportsEnergyMeter": false,
"typeSupportsHVAC": false,
"typeSupportsIO": false,
"typeSupportsOnOff": false,
"typeSupportsSensorValue": true,
"typeSupportsSpeedControl": false,
"typeSupportsSprinkler": false,
"versByte": 0,
"restParent": "devices"
}