添加自定义 class 到 md-dialog-container
Add custom class to md-dialog-container
我有一个按钮可以打开 md-dialog-container
。是否可以将自定义 class 添加到 md-dialog-container
的根?
<button class="button bluebutton right" ng-click="vm.launchContactActivityPopup()" ng-if="vm.isPersisted()" ng-disabled="!vm.isAllowedToRegisterContactActivity()">Contactd vastleggen</button>
public launchContactActivityPopup(): void {
this.$mdDialog.show({
template: `<register-contact-activity-popup></register-contact-activity-popup>`,
targetEvent: null,
clickOutsideToClose: false
});
}
使用panelClass
:
public launchContactActivityPopup(): void {
this.$mdDialog.show({
template: `<register-contact-activity-popup></register-contact-activity-popup>`,
targetEvent: null,
clickOutsideToClose: false,
panelClass: 'myClass'
});
}
这样修好了。
<md-dialog class="myClass">
<register-contact-activity-popup></register-contact-activity-popup>
</md-dialog>`,>`,
我有一个按钮可以打开 md-dialog-container
。是否可以将自定义 class 添加到 md-dialog-container
的根?
<button class="button bluebutton right" ng-click="vm.launchContactActivityPopup()" ng-if="vm.isPersisted()" ng-disabled="!vm.isAllowedToRegisterContactActivity()">Contactd vastleggen</button>
public launchContactActivityPopup(): void {
this.$mdDialog.show({
template: `<register-contact-activity-popup></register-contact-activity-popup>`,
targetEvent: null,
clickOutsideToClose: false
});
}
使用panelClass
:
public launchContactActivityPopup(): void {
this.$mdDialog.show({
template: `<register-contact-activity-popup></register-contact-activity-popup>`,
targetEvent: null,
clickOutsideToClose: false,
panelClass: 'myClass'
});
}
这样修好了。
<md-dialog class="myClass">
<register-contact-activity-popup></register-contact-activity-popup>
</md-dialog>`,>`,