Skip to content

Instantly share code, notes, and snippets.

@robwormald
Created December 2, 2013 09:37
Show Gist options
  • Save robwormald/7747149 to your computer and use it in GitHub Desktop.
Save robwormald/7747149 to your computer and use it in GitHub Desktop.
//inside controller
var currentState = 'foo'
$scope.getActiveTab = function(tabName){
if(tabName == currentState){
return true;
}
else{
return false
}
}
//in tempalte
<li ng-class="{active : getActiveTab('tab1')}">Tab 1</li>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment