I am trying to create an ng-class that sets the tab class to "active" based on the current day of the week utilizing JavaScripts getDay() which applies numbers 0-6 to each day of the week. So if it's Monday, check the currentDay if it is equal to 1 apply class, if it's Tuesday's tab check the currentDay, if it is equal to 2 apply the class to tuesday, etc. e.g:
Javascript (I tried putting this into a $scope object in my controller but that didn't seem to work either):
var d = new Date();
var currentDay = d.getDay();
View
<ul class="nav nav-tabs">
<li ng-class="{'active' : currentDay == 4}">
<a href="schedule/#thursday" data-toggle="tab">
<h2>Day 1 | Thursday</h2>
</a>
</li>
<li>
...
</li>
</ul>
I've tried multiple different ways to get this to work. If I check currentDay == 4 in the console (since today is Thursday) it comes back as 'true'. So the class should be applied. I also tried without the ' ' around active, and putting the condition in [ ]. Nothing seems to work.. Appreciate any input, thank you!