Is there a way to add the ".active" class to item 1 by only checking the classes in item 2 using a scrollspy directive? The goal is to have the header bar contain a certain class when the first nav item has the ".active" class. Check out this simplified example for reference: jsfiddle
<div ng-app>
<div ng-controller='ctrl'>
<div id="item1" ng-class="if item2 has class=active then add active class here">Item 1</div>
<div id="item2" ng-class="myVar">Item 2</div>
</div>
//I can't use a scope object I can only look at item 2's classes
<button type="button" ng-click="myVar='active'">Add Class</button>
<button type="button" ng-click="myVar=''">Remove Class</button>