Different class for the last element in ng-repeat

前端 未结 6 2064
情话喂你
情话喂你 2020-12-04 12:01

I am creating a list using ng-repeat something like this

  
{{file.name}}

But for

6条回答
  •  暖寄归人
    2020-12-04 12:11

    It's easier and cleaner to do it with CSS.

    HTML:

    {{ file.name }}

    CSS:

    .file:last-of-type {
        color: #800;
    }
    

    The :last-of-type selector is currently supported by 98% of browsers

提交回复
热议问题