What is the best way to conditionally apply a class?

后端 未结 22 2778
感动是毒
感动是毒 2020-11-22 09:12

Lets say you have an array that is rendered in a ul with an li for each element and a property on the controller called selectedIndex.

22条回答
  •  天命终不由人
    2020-11-22 09:34

    well i would suggest you to check condition in your controller with a function returning true or false .

    {{day.date}}

    and in your controller check the condition

    $scope.getTodayForHighLight = function(today, date){
    return (today == date);
    }
    

提交回复
热议问题