Reputation: 1007
When the High Contrast Mode is on, I need to use the dark theme and is working as below:
$mdThemingProvider.theme('default')
.primaryPalette('green')
.accentPalette('orange', {
'hue-3': 'A700'
}).dark();
But, I need to apply .dark() only when some condition is true and that data is available in controller only. Is there a way to apply the .dark() over the theme from the controller?
I tried to inject ngMaterial
in the controller's module and $mdThemingProvider
as dependency in that controller and copy-pasted above code but getting below error:
Unknown provider: $mdThemingProviderProvider <- $mdThemingProvider
Upvotes: 1
Views: 161