code: function updateThemeClass(theme) {
          if (!theme) return;
          if (!registered(theme)) {
            $log.warn('Attempted to use unregistered theme \'' + theme + '\'. ' +
                      'Register it with $mdThemingProvider.theme().');
          }
  
          var oldTheme = el.data('$mdThemeName');
          if (oldTheme) el.removeClass('md-' + oldTheme +'-theme');
          el.addClass('md-' + theme + '-theme');
          el.data('$mdThemeName', theme);
          if (ctrl) {
            el.data('$mdThemeController', ctrl);
          }
        }
docs: Remove old theme class and apply a new one
  NOTE: if not a valid theme name, then the current name is not changed