Dynamically loading a material theme in angular

前端 未结 6 1943
广开言路
广开言路 2020-12-10 07:55

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

6条回答
  •  误落风尘
    2020-12-10 08:37

    This is easier now. You only have to omit the first step. In resume:

    1. Add reload: generateThemes in themingProvider function (angular-material.js)
    2. Make the provider available to your controllers:

      $provide.value('themeProvider', $mdThemingProvider);

    3. Create your theme in your controller using themeProvider

    4. Reload themes using themeProvider.reload($injector);

提交回复
热议问题