I am facing an issue with my array structure:
{
key : 'abc',
color: 'Red',
show: true
}
<div ng-repeat="x in myArray">
<input type="checkbox" ng-model="x" ng-change="changeShow($index)" checked="checked" />
<div style="background-color:{{x.color}}; width: 5px;" class="left"> </div>
<label>{{x.key}}</label>
{{x}}
</div>
$scope.changeShow = function (index) {
$scope.myArray[index].show = !$scope.myArray[index].show;
}
However, the problem arises when I interact with checkboxes, causing only true
/false
to render and making the color
and name
disappear. Why is this happening?