0

I have a nested list of object up to three level state. For each object there is a nested object itself up to n-level. I want to bind that object directly with the checkbox such that if I check any item It should get a direct impact on that particular object. IS there any way in angular to do that? A sample object is below.

Object which I am getting from the server side:

[{
    "name": "nvs_core",
    "discovered": [{
        "name": "tag",
        "Fields": [{
            "name": "tag",
       }]
    }]
    }]
}, {
    "name": "nvs_core_trial",
    "discovered": [{
        "name": "nvs_src_tag",
        "Fields": [{
            "name": "nid",
        }]
    }, 
    }]
}]

1 Answer 1

0

you can attach model to your checkbox, if you want a different values for checked/unchecked you can see example here https://docs.angularjs.org/api/ng/input/input%5Bcheckbox%5D bottom page

<input type="checkbox" ng-model="myobj.discovered.Fields.name.checked" ng-repeat="myobj in ArrayOfObjects"/> 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.