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

docs(theming): added documentation to $mdTheming service #9476

Merged
merged 1 commit into from
Sep 8, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 28 additions & 3 deletions docs/config/template/ngdoc/lib/properties.template.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,34 @@
{%- if doc.properties %}
<section class="api-section">
<h2>Properties</h2>
<div class="api-param-table">
{$ propertyTable(doc.properties) $}
</div>
<br/>
<ul class="methods">
{%- for property in doc.properties %}
<li id="{$ property.name $}">
<h3 class="method-function-syntax">
<code class="method-function-syntax">{$ doc.name $}.{$ property.name $}</code>
</h3>
<div class="service-desc">{$ property.description | marked $}</div>

<div class="method-param-table">

{% if property.params %}
{$ paramTable(property.params) $}
{% endif %}

{% if method.this %}
<h4>Property's {% code %}this{% endcode %}</h4>
{$ property.this | marked $}
{% endif %}

{% if property.returns %}
{$ returnTable(property.returns) $}
{% endif %}

</div>

</li>
{% endfor -%}
</ul>
</section>
{%- endif -%}
76 changes: 72 additions & 4 deletions src/core/services/theming/theming.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 <b>classes</b> to itself.
*
* ```js
* <hljs lang="js">
* app.directive('myFancyDirective', function($mdTheming) {
* return {
* restrict: 'e',
Expand All @@ -534,9 +535,76 @@ function ThemingProvider($mdColorPalette, $$mdMetaProvider) {
* }
* };
* });
* ```
* @param {el=} element to apply theming to
* </hljs>
* @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:<br/>
* `theme` - A defined theme via `$mdThemeProvider` to use the palettes from. Default is `default` theme.<br/>
* `palette` - Can be any one of the basic material design palettes, extended defined palettes and 'primary',
* 'accent', 'background' and 'warn'. Default is `primary`<br/>
* `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.
Expand Down