diff --git a/src/core/services/theming/theming.js b/src/core/services/theming/theming.js index 7c633b50e8e..d8663474ff4 100644 --- a/src/core/services/theming/theming.js +++ b/src/core/services/theming/theming.js @@ -532,6 +532,12 @@ function ThemingProvider($mdColorPalette, $$mdMetaProvider) { * restrict: 'e', * link: function(scope, el, attrs) { * $mdTheming(el); + * + * $mdTheming.defineTheme('myTheme', { + * primary: 'blue', + * accent: 'pink', + * dark: true + * }) * } * }; * }); @@ -605,6 +611,24 @@ function ThemingProvider($mdColorPalette, $$mdMetaProvider) { * @returns {Function} remove function of the browser color */ + /** + * @ngdoc method + * @name $mdTheming#defineTheme + * @description + * Dynamically define a theme by an options object + * + * options are:
+ * `primary` - The primary palette of the theme.
+ * `accent` - The accent palette of the theme.
+ * `warn` - The warn palette of the theme.
+ * `background` - The background palette of the theme.
+ * `dark` - Indicates if it's a dark theme.
+ * + * @param {String} name Theme name to define + * @param {Object} options Theme definition options + * @returns {Promise} A resolved promise with the theme name + */ + /* @ngInject */ function ThemingService($rootScope, $mdUtil, $q, $log) { // Allow us to be invoked via a linking function signature.