将自定义类添加到md-dialog-container

时间:2018-04-16 14:02:31

标签: angularjs angular-material mddialog

我有一个打开md-dialog-container的按钮。是否可以将自定义类添加到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
  });
}

2 个答案:

答案 0 :(得分:2)

修正了这个问题。

<md-dialog class="myClass">
    <register-contact-activity-popup></register-contact-activity-popup>
</md-dialog>`,>`,

答案 1 :(得分:0)

使用panelClass

public launchContactActivityPopup(): void {
    this.$mdDialog.show({
        template: `<register-contact-activity-popup></register-contact-activity-popup>`,
        targetEvent: null,
        clickOutsideToClose: false,
        panelClass: 'myClass'
    });
}