angularjs - 有没有办法在 Material Design Lite 中创建对话框?

标签 angularjs angular-material material-design-lite

我已经使用 Angular Material 创建了对话框,但到目前为止还没有找到一种使用 Material Design Lite 创建对话框的方法。有解决办法吗?

最佳答案

MDL 支持 HTML5 对话框样式,但不包含任何填充内容。所以你必须有一个支持它们的浏览器(比如 Chromium)。否则使用像https://github.com/GoogleChrome/dialog-polyfill这样的polyfill正如@manuel-84所指出的

<dialog id="dialog" class="mdl-dialog">
    <h4 class="mdl-dialog__title">Hello User</h4>
    <div class="mdl-dialog__content">
      <p>Hello world from dialog!<p>
    </div>
    <div class="mdl-dialog__actions">
      <button type="button" class="mdl-button close">Disagree</button>
    </div>
</dialog>

并在某处使用按钮调用

document.getElementById('dialog').showModal();

参见Material Design Lite Components : Dialogs

关于angularjs - 有没有办法在 Material Design Lite 中创建对话框?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34799101/

相关文章:

javascript - Angular Material md-datepicker 和 md-select 验证

css - Material-Design-Lite,在没有 !important 的情况下覆盖 styleguide 属性

java - Spring Security 注销不适用于 Spring 4 CORS

javascript - 从回调函数更改模型值

Angular flex-layout - fxLayoutGap 在包装行的末尾导致烦人的间隙

javascript - 禁用 Material Design Lite 切换开关

javascript - Material Design Lite + React - 工具提示问题

jquery - outerHeight(true) 不包括边距?

AngularJS - 从范围加载 HTML 实体作为货币符号

javascript - 如何以 Angular 6 显示垫表中每一行的垫旋转器