Angular2 Sorting Pipe with Object Array

后端 未结 3 1747
余生分开走
余生分开走 2021-01-14 05:01

How to make a sorting pipe in angular2 with an array of objects

Original Problem:

I have a TODOs list, (Todo[ ]) and I want to sort it every time I make

3条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2021-01-14 05:33

    You need to change your html template so that your pipe can accommodate your async code.

    Change this line:

  • (...)
  • To this:

  • (...)
  • I copied your Pipe code into this Plunker:

    https://plnkr.co/edit/RBpZilgxIyRDLwktNZN1?p=preview

提交回复
热议问题