angular-hint icon indicating copy to clipboard operation
angular-hint copied to clipboard

Warn for orderBy getting called function in template

Open jeffbcross opened this issue 11 years ago • 0 comments

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>

jeffbcross avatar Oct 31 '14 16:10 jeffbcross