【问题标题】:How to display remote html page in modal window in Angular JS?如何在 Angular JS 的模态窗口中显示远程 html 页面?
【发布时间】:2016-12-18 16:39:32
【问题描述】:

引导示例:

<a class="btn btn-lg btn-default"
     data-toggle="modal"
     data-target="#remoteModal"
     href="remote-page.html">Open modal window</a>

我可以使用 Angular 引导程序 (http://angular-ui.github.io/bootstrap/) 或使用其他库来做同样的事情吗?

【问题讨论】:

  • 当您点击它时,您的 url 是否返回您的 html 页面?我对angularjs一无所知

标签: angularjs angular-ui-bootstrap bootstrap-modal


【解决方案1】:

您需要在模态标记中“嵌入”远程页面,&lt;iframe&gt; 是一种方法。

<div class="modal-body" id="modal-body">
    <iframe src="https://mdn-samples.mozilla.org/snippets/html/iframe-simple-contents.html" width="400" height="300">
        <p>Your browser does not support iframes.</p>
    </iframe>
</div>

Here's a forked plunk 来自模态示例。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-08-01
    • 2012-12-31
    • 1970-01-01
    • 2021-01-19
    • 1970-01-01
    • 2014-06-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多