Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit cd64fdb

Browse files
committed
docs(theming): added documentation to $mdTheming service
1 parent 3854c4a commit cd64fdb

File tree

2 files changed

+100
-7
lines changed

2 files changed

+100
-7
lines changed
Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,34 @@
11
{%- if doc.properties %}
22
<section class="api-section">
33
<h2>Properties</h2>
4-
<div class="api-param-table">
5-
{$ propertyTable(doc.properties) $}
6-
</div>
4+
<br/>
5+
<ul class="methods">
6+
{%- for property in doc.properties %}
7+
<li id="{$ property.name $}">
8+
<h3 class="method-function-syntax">
9+
<code class="method-function-syntax">{$ doc.name $}.{$ property.name $}</code>
10+
</h3>
11+
<div class="service-desc">{$ property.description | marked $}</div>
12+
13+
<div class="method-param-table">
14+
15+
{% if property.params %}
16+
{$ paramTable(property.params) $}
17+
{% endif %}
18+
19+
{% if method.this %}
20+
<h4>Property's {% code %}this{% endcode %}</h4>
21+
{$ property.this | marked $}
22+
{% endif %}
23+
24+
{% if property.returns %}
25+
{$ returnTable(property.returns) $}
26+
{% endif %}
27+
28+
</div>
29+
30+
</li>
31+
{% endfor -%}
732
</ul>
833
</section>
934
{%- endif -%}

src/core/services/theming/theming.js

Lines changed: 72 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -520,12 +520,13 @@ function ThemingProvider($mdColorPalette, $$mdMetaProvider) {
520520
/**
521521
* @ngdoc service
522522
* @name $mdTheming
523+
* @module material.core.theming
523524
*
524525
* @description
525526
*
526-
* Service that makes an element apply theming related classes to itself.
527+
* Service that makes an element apply theming related <b>classes</b> to itself.
527528
*
528-
* ```js
529+
* <hljs lang="js">
529530
* app.directive('myFancyDirective', function($mdTheming) {
530531
* return {
531532
* restrict: 'e',
@@ -534,9 +535,76 @@ function ThemingProvider($mdColorPalette, $$mdMetaProvider) {
534535
* }
535536
* };
536537
* });
537-
* ```
538-
* @param {el=} element to apply theming to
538+
* </hljs>
539+
* @param {element=} element to apply theming to
539540
*/
541+
542+
/**
543+
* @ngdoc property
544+
* @name $mdTheming#THEMES
545+
* @description
546+
* Property to get all the themes defined
547+
* @returns {Object} All the themes defined with their properties
548+
*/
549+
550+
/**
551+
* @ngdoc property
552+
* @name $mdTheming#PALETTES
553+
* @description
554+
* Property to get all the palettes defined
555+
* @returns {Object} All the palettes defined with their colors
556+
*/
557+
558+
/**
559+
* @ngdoc method
560+
* @name $mdTheming#registered
561+
* @description
562+
* Determine is specified theme name is a valid, registered theme
563+
* @param {string} themeName the theme to check if registered
564+
* @returns {boolean} whether the theme is registered or not
565+
*/
566+
567+
/**
568+
* @ngdoc method
569+
* @name $mdTheming#defaultTheme
570+
* @description
571+
* Returns the default theme
572+
* @returns {string} The default theme
573+
*/
574+
575+
/**
576+
* @ngdoc method
577+
* @name $mdTheming#generateTheme
578+
* @description
579+
* Lazy generate themes - by default, every theme is generated when defined.
580+
* You can disable this in the configuration section using the
581+
* `$mdThemingProvider.generateThemesOnDemand(true);`
582+
*
583+
* The theme name that is passed in must match the name of the theme that was defined as part of the configuration block.
584+
*
585+
* @param name {string} theme name to generate
586+
*/
587+
588+
/**
589+
* @ngdoc method
590+
* @name $mdTheming#setBrowserColor
591+
* @description
592+
* Sets browser header coloring
593+
* for more info please visit:
594+
* https://developers.google.com/web/fundamentals/design-and-ui/browser-customization/theme-color
595+
*
596+
* The default color is `800` from `primary` palette of the `default` theme
597+
*
598+
* options are:<br/>
599+
* `theme` - A defined theme via `$mdThemeProvider` to use the palettes from. Default is `default` theme.<br/>
600+
* `palette` - Can be any one of the basic material design palettes, extended defined palettes and 'primary',
601+
* 'accent', 'background' and 'warn'. Default is `primary`<br/>
602+
* `hue` - The hue from the selected palette. Default is `800`
603+
*
604+
* @param {Object} options Options object for the browser color
605+
* @returns {Function} remove function of the browser color
606+
*/
607+
540608
/* @ngInject */
541609
function ThemingService($rootScope, $log) {
542610
// Allow us to be invoked via a linking function signature.

0 commit comments

Comments
 (0)