-
Notifications
You must be signed in to change notification settings - Fork 1.8k
"track by" in simple comprehension expression broke when updating from 0.11.2 to 0.13.1 #1233
Comments
Same true to me. Adding a filter fixes the issue:
|
As much as I appreciate your workaround, @dangoodman, it doesn't fix the issue. 😉 I really hope this issue will be properly fixed in the future, as adding a filter does not make much sense in my case where the list of questions is updated, and filtered, through an async (AJAX) server call. |
Sure, it's just a workaround, not a real fix. |
Happens to me also, but when updating from 0.13.1 to 0.13.2. <ui-select-choices repeat="product in dropdownVM.productsForDropDown track by product.id"
refresh="dropdownVM.searchProducts($select.search)"
refresh-delay="0"> |
+1 |
@rgiosa, thank you!! Downgrading from 0.13.2 to 0.13.1 worked for me as well. |
0.13.1 didn't work for me. |
0.13.1 didn't work for me neither. Any solution? |
I got this issue too and need to downgrade to 0.13.0 for it to work. The part that handle the filter block in the regexp for repeatFilter may be the cause. There is a | character that isn't escaped but we actually want to match the char, and this filter block should probably be optional also. |
This issue also affects custom filters: <ui-select-choices
repeat="result in results
| customFilter:$select.search
| orderBy: result.score track by: result.result
"> Throws the same error |
A workaround I found from #1270 was to wrap the collection in parens: <ui-select-choices repeat="user in (ctrl.users) track by $index" ...> |
@techniq +1 |
Previously the parser always attempted to extract a filter from the repeat expression, regardless of whether it was present or not. This resulted in the track by part of the expression being interpreted as a filter. This commit changes the parser regex to capture the entire object source, including its filters, before matching any track by expression. The filters are then extracted separately from the source as this step is only required when using an object as a source. Fixes angular-ui#1233
Thanks @jfairley, it worked for me as well. And I think that the version is not properly stated: Version: 0.14.8 - 2016-02-18T22:01:43.792Z |
The expressions
used to work in 0.11.2, but after I upgraded to 0.13.1, I receive the following error:
Changing the
repeat
value torepeat="question in questions"
avoids the error message, but is probably taking a toll in reduced performance.The text was updated successfully, but these errors were encountered: