Skip to content
This repository was archived by the owner on Apr 4, 2025. It is now read-only.
This repository was archived by the owner on Apr 4, 2025. It is now read-only.

Warn for orderBy getting called function in template #46

Open

Description

@jeffbcross

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>

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions