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>
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:
Good:
Acceptable Advanced Usage: