Search code examples
angularjsangularjs-orderby

Angular orderBy order of operations


I could not find an answer in the documentation, if I order by 2 or more params:

<tbody ng-reapet="i in list" | orderBy:['m_status', 'm_couter']>

What would be the order in orderBy? m_status or m_counter will be first to orderBy? It is hard to test based on 2 or more.

Thanks.

It work fine, this is not a syntax or "how to.." question, my question is how Angular prioritize the array inside orderBy - ['m_status', 'm_counter'].


Solution

  • Try it as below

    <tbody ng-repeat="i in list | orderBy:['m_status', 'm_couter']">

    orderBy filter must be in ng-repeat as below

    `ng-repeat="some in somelist |orderBy:'name'"`