Within my ng-repeat loop, I am trying to implement the following toggle functionality:
<a href='#' ng-model="collapsed{{$index}}" ng-click="collapsed{{$index}}=!collapsed{{$index}}">{{item.type}}</a>
<div ng-show="collapsed{{$index}}">
{{item.type}}
</div>
However, I am encountering errors as ng-model and ng-click do not seem to work well with {{ }} syntax. I have also attempted using [$index] without success.
Does anyone have suggestions on the correct approach to achieve this functionality in a way that each iteration can maintain its own collapsed state?