0
如何使用document.getElementById获取模态元素?我试图通过我的家庭组件打字稿文件中的代码手动显示和隐藏模式。获取Angular 2打字稿中的模态元素
我已经有一个工作模式,在按下按钮时工作 - 现在我想在代码中出现某些情况时手动切换模式。
我:
var errorModalBox = document.getElementById("errorModal");
errorModalBox.modal('show');
然而,第二行引发以下错误:
Property 'modal' does not exist on type 'HTMLElement'.
感谢。完美的作品。 – Roka545
太棒了。很高兴帮助! – Kirkify