Revert "Revert "refactor(ng-repeat): refactor the fix for #1015""

Re-apply this in 0.14.0