Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Warn for orderBy getting called function in template #46

Open
jeffbcross opened this issue Oct 31, 2014 · 0 comments
Open

Warn for orderBy getting called function in template #46

jeffbcross opened this issue Oct 31, 2014 · 0 comments

Comments

@jeffbcross
Copy link

I've seen apps that don't realize that orderBy is supposed to be given a reference to a getter function, rather than calling the function directly. But there are advanced cases where assigning the result of a function to orderBy is warranted, so a little "are you sure?" nudge would be helpful.

Bad:

<li ng-repeat="item in items | orderBy:getItemLabel()"></li>

Good:

<li ng-repeat="item in items | orderBy:getItemLabel"></li>

Acceptable Advanced Usage:

<li ng-repeat="item in items | orderBy:getSortPropertyName()"></li>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant