-
Notifications
You must be signed in to change notification settings - Fork 3.4k
add the reload function inside the themingProvider #5074
Conversation
add the reload function inside the themingProvider
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project, in which case you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
This will be very useful for us too! One question: Shouldn't the reload function be Thanks! |
+1 |
@rschmukler, @jelbourn - can you review plz. |
This needs documentation and at least one unit test making sure that calling |
in 1.0-rc6 it has to be "reload: generateAllThemes" to work, but this still throws some warning logs |
+1 (a real important feature for multi-sites angular-based CMS initiatives, where theming is dynamic and set at run time) |
@jelbourn i remember that registering themes on the fly was an idea, |
The change seems okay, but it still needs unit testing. |
@fmarcelo please add tests |
Would this also allow dynamic registration of palettes ? In my use case I need to get hex values from a backend service and use that to create palettes. No luck with any of these changes |
This issue is closed as part of our ‘Surge Focus on Material 2' efforts. |
We were trying to register theme on the fly and the only way to do it is assign $mdThemingProvider as $provide.value('themeService', $mdThemingProvider) inside the angular config.
In this case the themeService will be accessible to angular controllers and we can registerTheme with $http resolve values.
To apply the theme we call themeService.reload($injector);