This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
Moving aliasing special properties of ngRepeat from ngInit to ngRepeat #5623
Closed
Description
Currently the only one appropriate use of ngInit is aliasing $index
and other special properties of ngRepeat.
I'd like suggest moving this functionality to ngRepeat.
It could look like:
<li ng-repeat="city in cities track by $index, $index as cityIndex, $middle as isCityMiddle">
Pros:
- Aliasing is needed for ngRepeat, not ngInit.
Cons:
- Will add more functionality to ngRepeat.
Right now it's one of the biggest directives if LoC is concerned.
Also, just to make writing hello-worlds on plunker a little tougher, removing ngInit entirely could be considered.
Yes, I know I'm crazy, but this could be only done if there are really few hackish solutions which employ ngInit.
Just wanted to know that you guys think of this.