This repository was archived by the owner on Sep 5, 2024. It is now read-only.
This repository was archived by the owner on Sep 5, 2024. It is now read-only.
md-dialog: Theme not updating #5899
Closed
Description
// register themes (in config)
$mdThemingProvider.setDefaultTheme('blue-grey');
$mdThemingProvider.theme('blue-grey').primaryPalette('blue-grey');
$mdThemingProvider.theme('red').primaryPalette('red');
...
// bind model to theme
<md-select ng-model="vm.company.theme" required>
<md-option ng-repeat="item in vm.palettes" >{{item}}</md-option>
</md-select>
// index.html
<body md-theme="{{vm.company.theme}}">
// always watch (in config)
$mdThemingProvider.alwaysWatchTheme(true);
// in the controller
vm.openTicketDialog = function(ev) {
$mdDialog.show({
controller: TicketCtrl,
controllerAs: 'vm',
templateUrl: 'dashboard/tickets/createTicketView.html',
parent: angular.element(document.body),
targetEvent: ev,
clickOutsideToClose:true
})
}
// the html partial (createTicketView.html)
<md-dialog flex-sm="95" ng-cloak>
<md-toolbar>
<div class="md-toolbar-tools">
<h2>foobar</h2>
<span flex></span>
</div>
</md-toolbar>
...
</md-dialog>
I hope you understand the provided code snippets.
I bind a select input to the selected theme for the entire page and change it dynamicly on runtime.
That itself works great, but the dialog templates don't seem to get updated. That means, that the toolbar in the dialog and almost all elements in it aren't updated properly.
How can i fix that?