最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - With Angular Material Dialog, how to add multiple classes to the dialog? - Stack Overflow

programmeradmin5浏览0评论

I can add a custom class to a MatDialog this way:

    this.dialog.open(MyGreatDialogComponent, {
      data: myGreatData,
      panelClass: 'my-great-class',
    });

Is it possible to add an additional class(es) to a Material dialog?

I can add a custom class to a MatDialog this way:

    this.dialog.open(MyGreatDialogComponent, {
      data: myGreatData,
      panelClass: 'my-great-class',
    });

Is it possible to add an additional class(es) to a Material dialog?

Share Improve this question asked Apr 13, 2021 at 0:06 Tony BrasunasTony Brasunas 4,5923 gold badges46 silver badges57 bronze badges 2
  • 1 add typings to your project so you can immediately see such things panelClass?: string | string[]; – Petr Averyanov Commented Apr 13, 2021 at 1:06
  • Thanks! Obvious, I guess. Just answered my own question in case someone else comes looking for it, so as not to waste anyone's time, as this wasn't posted anywhere else. – Tony Brasunas Commented Apr 13, 2021 at 1:16
Add a comment  | 

1 Answer 1

Reset to default 25

Quite simple to use an array of classes:

    this.dialog.open(MyGreatDialogComponent, {
      data: myGreatData,
      panelClass: ['my-great-class', 'my-other-great-class'],
    });
发布评论

评论列表(0)

  1. 暂无评论