angular keyvalue pipe sort properties / iterate in order

前端 未结 11 962
有刺的猬
有刺的猬 2020-11-29 21:01

When using the Angular keyvalue pipe to iterate over an object\'s properties as follows:

11条回答
  •  悲&欢浪女
    2020-11-29 21:34

    You can keep the original order by simply setting the keyvalue pipe to an empty object {}

    *ngFor="let property of collection | keyvalue: {}"
    

提交回复
热议问题