Angular 2 ngfor first, last, index loop

后端 未结 3 2015
耶瑟儿~
耶瑟儿~ 2021-01-30 05:00

I\'m trying to set as default the first occurrence in this example: plunkr

getting the following error:

    Unhandle         


        
3条回答
  •  广开言路
    2021-01-30 05:25

    By this you can get any index in *ngFor loop in ANGULAR ...

    • // write your code...
      // write your code...

    We can use these alias in *ngFor

    • index : number : let i = index to get all index of object.
    • first : boolean : let first = first to get first index of object.
    • last : boolean : let last = last to get last index of object.
    • odd : boolean : let odd = odd to get odd index of object.
    • even : boolean : let even = even to get even index of object.

提交回复
热议问题