I'm having trouble rendering dynamic checkboxes with JSON API response.
There are 2 ng-repeats:
Below my HTML code;
<ul class="list-group">
<li class="list-group-item" ng-repeat="cats in categorias">
<div class="checkbox"><label><input type="checkbox" ng-model="checkbox[item.cats]"><span class="checkbox-material"><span class="check"></span></span></label> {{cats.name}}</div>
</li>
</ul>
Below my JSON / API response (1)
[
{"id":"1","id_module":"1","name":"Esportes"},
{"id":"2","id_module":"1","name":"Entretenimento"},
{"id":"3","id_module":"1","name":"Terror"},
{"id":"4","id_module":"1","name":"Drama"}
]
Another JSON output (2)
{cats":["1","2"]}
I would like the checkboxes to be checked with the answer above.
Does anyone have an idea?