These are chat archives for angular/material

12th
Mar 2016
Roland Groza
@rolandjitsu
Mar 12 2016 14:13
hey guys ... is there any way I can get the backgroundPalette for the current default theme? Because it seems like there is no good way to apply a background color to an element depending on what theme is applied ...
Ishan Khare
@ishankhare07
Mar 12 2016 14:47
@rolandjitsu I think you should look in the theming section of online docs
Roland Groza
@rolandjitsu
Mar 12 2016 14:48
those docs document how to set the backgroundPalette, not how to get it programatically ...
Roland Groza
@rolandjitsu
Mar 12 2016 14:55
I am trying to apply the default theme backgroundPalette color as background to a custom directive ...
it should basically behave the same way the <md-toolbar> does
Ishan Khare
@ishankhare07
Mar 12 2016 15:26
I guess you should try the md-background attribute to your directive
Will try to make a codepen for it
Try this https://material.angularjs.org/latest/Theming/03_configuring_a_theme it shows changing theme attributes using JavaScript
Roland Groza
@rolandjitsu
Mar 12 2016 15:30
there is no such an attr mdBackground ... and as I said, the docs show how to configure a theme or add your own, but I haven't seen any docs on how to get a color from the palette or programatically apply a background to an element ...
I can find a $mdTheming(), but using it does pretty much nothing