Mpondomise Mpondomise - 1 year ago 114
AngularJS Question

angularjs nested ng-repeat of checkbox

I have the following ng-repeat list. I want to convert it to checkboxes.

Currently, it is repeating the category headings in myJSON.mylist and then repeating each subitem in each category in list mode.

How can I convert the list type into checkbox type, so that ONLY subitems can be chosen?

<ul ng-repeat="s in myJSON.mylist">
<li type="checkbox"> {{s.item}}</li>
<ul >
<li type="checkbox" ng-repeat="subitem in s.subitems">

here is a similar example.

Answer Source

you can go like this:

<div ng-repeat="sin myJSON.mylist">
    <div > {{s.item}}</div>
    <ul >
        <li ng-repeat="subitem in s.subitems">
            <input type="checkbox" name="myname"
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download