code: function getTabIndex( tab ) {
  					var index = 0;
  					if ( tab && typeof( tab ) === 'string' ) {
  						/* DOM isn't fast enough for this
  
  						var tabs = $element[0].querySelector('.md-color-picker-colors').getElementsByTagName( 'md-tab' );
  						console.log( tabs.length );
  						*/
  						var tabName = 'mdColor' + tab.slice(0,1).toUpperCase() + tab.slice(1);
  						var tabs = ['mdColorSpectrum', 'mdColorSliders', 'mdColorGenericPalette', 'mdColorMaterialPalette', 'mdColorHistory'];
  						for ( var x = 0; x < tabs.length; x++ ) {
  							//console.log(  tabs[x]('ng-if') );
  							//if ( tabs[x].getAttribute('ng-if') == tabName ) {
  							if ( tabs[x] == tabName ) {
  								if ( $scope[tabName] ) {
  									index = x;
  									break;
  								}
  							}
  						}
  					} else if ( tab && typeof ( tab ) === 'number') {
  						index = tab;
  					}
  
  					return index;
  				}
docs: console.log( "mdColorPickerContainer Controller", Date.now() - dateClick, $scope );