don't know if you care about golfing this down, but you could change it to
```javascript
$scope.toggleTab = function(tab) {
  $scope.showTab = $scope.showTab == tab ? null : tab;
}
```