Skip to content

Commit

Permalink
docs(theming): defineTheme documentation (angular#10476)
Browse files Browse the repository at this point in the history
  • Loading branch information
EladBezalel authored and mmalerba committed Mar 13, 2017
1 parent 2cd5018 commit e1bb097
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/core/services/theming/theming.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
* })
* }
* };
* });
Expand Down Expand Up @@ -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:<br/>
* `primary` - The primary palette of the theme.<br/>
* `accent` - The accent palette of the theme.<br/>
* `warn` - The warn palette of the theme.<br/>
* `background` - The background palette of the theme.<br/>
* `dark` - Indicates if it's a dark theme.<br/>
*
* @param {String} name Theme name to define
* @param {Object} options Theme definition options
* @returns {Promise<string>} A resolved promise with the theme name
*/

/* @ngInject */
function ThemingService($rootScope, $mdUtil, $q, $log) {
// Allow us to be invoked via a linking function signature.
Expand Down

0 comments on commit e1bb097

Please sign in to comment.