Within my code, I am utilizing two nested ng-repeat functions and I am looking to change the $last variable to something different for each level - let's say outerLast and innerLast. I attempted to achieve this by using ng-init="outerLast= $last" and ng-init="innerLast= $last", but unfortunately it did not work as expected. Both variables always hold true values. It seems that this issue arises because $last transitions from true to false in the last child scope of the previous iteration when a new iteration begins, thus possibly preventing ng-init from creating a proper linkage between the new variables and $last.
What would be an effective method to implement the desired behavior for the outerLast and innerLast variables?