{{ item.type ...">

Angular 4 combine orderBy and translate pipe

I have the following:

<div>
  <ul>
    <li *ngFor="let item of array | orderBy: 'type'">
      {{ item.type | translate }}
    </li>
  </ul>
</div>

      

i18n translation

is executed inside the block li

. Then, no matter what the translation is, orderBy

no language is needed in the pipe to sort the array.

How can I order in a specific language?

  • do something like: let item of array | translate: 'type' | orderBy: 'type'

  • use pipe translate

    in pipeorderBy

  • translate array to controller and then use orderBy

    sort
+3


source to share





All Articles