I\'m building an Angular application using Angular Material. One of the first steps in the application is that the user logs in. Next, the system loads from the backend the
.config(function ($mdThemingProvider, $provide) {
$provide.value('$mdThemingProvider', $mdThemingProvider);
});
Now you can inject $mdTheming
and $mdThemingProvider
in your controller and insert the code below in your controller.
$mdThemingProvider.theme().primaryPalette().accentPalette(>accent_color>);
$mdTheming.generateTheme();
If you want this to be your default theme, then:
$mdThemingProvider.setDefaultTheme();
or use md-theme="
in HTML.
PS: Works with Angular Material 1.1 and above.