mercredi 14 septembre 2016

ngrepeat checkbox in table rows

Good day everyone. I was hoping someone can help me with my Angular JS code. I have an image

enter image description here

which was populated based on this array of objects.

[
  {
    "groupName": "Group 1",
    "devices": [
      {
        "deviceId": "1111",
        "modelName": "Model 1",
        "baseModelName": "base1",
        "serialNumber": "ZZZZZZZZZZZ",
        "ipAddress": "10.191.21.50",
        "description": "Device 1"
      },
      {
        "deviceId": "2222",
        "modelName": "Model 2",
        "baseModelName": "base2",
        "serialNumber": "YYYYYYYY",
        "ipAddress": "10.191.21.168",
        "description": "Device 1"
      }
    ]
  },
  {
    "groupName": "Group 2",
    "devices": [
      {
        "deviceId": "333",
        "modelName": "Model 3",
        "baseModelName": "base3",
        "serialNumber": "XXXXXXXXXX",
        "ipAddress": "10.191.21.124",
        "description": "Device 1"
      }
    ]
  }
]

Would appreciate if anyone can help me in coding my angularjs javascript controller so that I can only check/uncheck the checkbox under the selected group(the radio button). Thank You.




Aucun commentaire:

Enregistrer un commentaire