I'm running into an issue with ng-class where in some weird edge cases it will apply the class I want to add to the element, but with with "-add" concatenated to the class-name. I think it might have something to do with this class allowing for animations to be applied as a transition state and the class without "-add" should be applied immediately after but it's just getting stuck on the "-add class for some reason.
This is the html code with the ng-class on the 4th div:
<div layout="column" hide-gt-sm show-sm class="desktop-dropdown">
<div flex class="context-container ham-btn" ng-click="displayDropdown = !displayDropdown">
<md-icon class="meevo-dropdown " md-svg-icon="assets/images/icons/meevo-dropdown.svg" ng-click="menu.closeMenu()" style="width: 50px;"></md-icon>
</div>
<div layout="column" class="desk-drop-container">
<div class="drop-item" ng-class="{'context-active': activeClass(context)}" ng-click="context.navigate()" ng-show="displayDropdown" layout="row" ng-repeat="context in contexts">
<a flex class="context-title">{{context.title}}</a>
<div ng-show="{{!context.isHomeContext}}" class="pull-right meevo-context-close" ng-click="context.close()">
<md-icon class="close-icon" md-svg-icon="assets/images/icons/meevo-circle-close.svg"></md-icon>
</div>
</div>
</div>
Basically this is for a navigation dropdown that only shows up on mobile devices and the current tab that the user is on should have that "context-active:" class applied to it by the ng-class. So when a user clicks between tabs or opens new ones the ng-class is working but when they close a tab using the md-icon button it closes that tab and navigates them to the one right in front of it, and this is where the ng-class is failing. The function activeClass() is returning true for the context, all it does is check a single property on the context and returns true or false, I just made it into a function so I could debug and see the return.
I have been having trouble recreating this issue anywhere else. Is there anything that angular does that I might be missing or something with ng-class or is there a way I can do this without utilizing ng-class?