From cf00d7c3ddc7683472b70e4f10e5e18c92b18a82 Mon Sep 17 00:00:00 2001 From: Elad Bezalel Date: Thu, 1 Sep 2016 03:19:26 +0300 Subject: [PATCH] docs(theming): added documentation to $mdTheming service --- .../ngdoc/lib/properties.template.html | 31 +++++++- src/core/services/theming/theming.js | 76 ++++++++++++++++++- 2 files changed, 100 insertions(+), 7 deletions(-) diff --git a/docs/config/template/ngdoc/lib/properties.template.html b/docs/config/template/ngdoc/lib/properties.template.html index 4a06c9bfea..91ad6c663b 100644 --- a/docs/config/template/ngdoc/lib/properties.template.html +++ b/docs/config/template/ngdoc/lib/properties.template.html @@ -1,9 +1,34 @@ {%- if doc.properties %}

Properties

-
- {$ propertyTable(doc.properties) $} -
+
+
{%- endif -%} diff --git a/src/core/services/theming/theming.js b/src/core/services/theming/theming.js index 31ebe48590..5a6f70a59f 100644 --- a/src/core/services/theming/theming.js +++ b/src/core/services/theming/theming.js @@ -520,12 +520,13 @@ function ThemingProvider($mdColorPalette, $$mdMetaProvider) { /** * @ngdoc service * @name $mdTheming + * @module material.core.theming * * @description * - * Service that makes an element apply theming related classes to itself. + * Service that makes an element apply theming related classes to itself. * - * ```js + * * app.directive('myFancyDirective', function($mdTheming) { * return { * restrict: 'e', @@ -534,9 +535,76 @@ function ThemingProvider($mdColorPalette, $$mdMetaProvider) { * } * }; * }); - * ``` - * @param {el=} element to apply theming to + * + * @param {element=} element to apply theming to */ + + /** + * @ngdoc property + * @name $mdTheming#THEMES + * @description + * Property to get all the themes defined + * @returns {Object} All the themes defined with their properties + */ + + /** + * @ngdoc property + * @name $mdTheming#PALETTES + * @description + * Property to get all the palettes defined + * @returns {Object} All the palettes defined with their colors + */ + + /** + * @ngdoc method + * @name $mdTheming#registered + * @description + * Determine is specified theme name is a valid, registered theme + * @param {string} themeName the theme to check if registered + * @returns {boolean} whether the theme is registered or not + */ + + /** + * @ngdoc method + * @name $mdTheming#defaultTheme + * @description + * Returns the default theme + * @returns {string} The default theme + */ + + /** + * @ngdoc method + * @name $mdTheming#generateTheme + * @description + * Lazy generate themes - by default, every theme is generated when defined. + * You can disable this in the configuration section using the + * `$mdThemingProvider.generateThemesOnDemand(true);` + * + * The theme name that is passed in must match the name of the theme that was defined as part of the configuration block. + * + * @param name {string} theme name to generate + */ + + /** + * @ngdoc method + * @name $mdTheming#setBrowserColor + * @description + * Sets browser header coloring + * for more info please visit: + * https://developers.google.com/web/fundamentals/design-and-ui/browser-customization/theme-color + * + * The default color is `800` from `primary` palette of the `default` theme + * + * options are:
+ * `theme` - A defined theme via `$mdThemeProvider` to use the palettes from. Default is `default` theme.
+ * `palette` - Can be any one of the basic material design palettes, extended defined palettes and 'primary', + * 'accent', 'background' and 'warn'. Default is `primary`
+ * `hue` - The hue from the selected palette. Default is `800` + * + * @param {Object} options Options object for the browser color + * @returns {Function} remove function of the browser color + */ + /* @ngInject */ function ThemingService($rootScope, $log) { // Allow us to be invoked via a linking function signature.