These are chat archives for angular/material

7th
May 2016
Michael Prentice
@Splaktar
May 07 2016 04:36
@0101adm there is a way to tell the themeprovider to watch for theme changes
It's not the default because of the performance impact, but it is possible
$mdThemingProvider.alwaysWatchTheme(true);
Aaron
@0101adm
May 07 2016 13:52
@Splaktar im fetching data, then setting the default theme to custom palettes. using that method doesnt seem to change the theme.
after my fetch, this block throws Attempted to use unregistered theme 'my-home-theme'. Register it with $mdThemingProvider.theme().
$mdThemingProvider
        .theme('my-home-theme')
            .primaryPalette('customPrimary')
            .accentPalette('customAccent')
            .warnPalette('customWarn')
            .backgroundPalette('customBackground');

    $mdThemingProvider.setDefaultTheme('my-home-theme');
Aaron
@0101adm
May 07 2016 13:57
if i set default to the custom palettes, along with alwaysWatchTheme, the theme doesnt change.
reading up on this, there is an undocumented function to generate the theme on demand, but my custom palettes are not available.
Michael Prentice
@Splaktar
May 07 2016 14:44
ah OK, you need to register themes dynamically in addition to changing them dynamically
Michael Prentice
@Splaktar
May 07 2016 14:50
what if you use default theme and alwaysWatchTheme at boot and then create/set your new theme when your custom pallettes come back from the server? or can you just modify the default theme when your colors come back instead of registering a new theme?
Aaron
@0101adm
May 07 2016 16:20
@Splaktar i've tried that, too. setting the theme @ boot, then setting the palettes of default after the fetch.
(using the default theme @ boot)
Michael Prentice
@Splaktar
May 07 2016 16:29
More exceptions or just no effect?
Aaron
@0101adm
May 07 2016 16:55
if i set default's palettes, no effect. if i try registering a new them (with custom palettes), i get Attempted to use unregistered theme 'my-home-theme'. Register it with $mdThemingProvider.theme().
@Splaktar ^
Eshan Singh
@naiveaiguy
May 07 2016 18:17
Hello, does anyone here have an experience of using Angular Material with Ionic? I am familiar with Ionic Material, however it does not really comply with the guidelines as much as Angular Material does. Can anybody give me some advice on how to get it set up?